commit 0a98735841e8b33edf62bd756ad8c6da2929247a from: Omar Polo date: Thu Feb 24 18:31:47 2022 UTC ring a bell when remotely opening a link + refactor it a bit move the logic into its own function. commit - 0d877486d2b85f6e333e50765e1f2cf8119da67c commit + 0a98735841e8b33edf62bd756ad8c6da2929247a blob - dd237f5f937a5f6cedda98d6050a81eee388f594 blob + 150898bba03e6cbac0ab17ae303ccb2696bda212 --- control.c +++ control.c @@ -31,7 +31,6 @@ #include "control.h" #include "minibuffer.h" -#include "session.h" #include "telescope.h" #include "utils.h" #include "ui.h" @@ -256,8 +255,7 @@ control_dispatch_imsg(int fd, short event, void *bula) if (uri[IMSG_DATA_SIZE(imsg)-1] != '\0') break; - new_tab(uri, NULL, NULL); - ui_on_tab_refresh(current_tab); + ui_remotely_open_link(uri); break; } default: blob - fc246f83cadcb8f31f2b8a7fb2de68b04cd61937 blob + fcf976c7f57b6998925409975bc245eb3a05fc5b --- include/ui.h +++ include/ui.h @@ -149,6 +149,7 @@ void ui_main_loop(void); void ui_on_tab_loaded(struct tab *); void ui_on_tab_refresh(struct tab *); void ui_on_download_refresh(void); +void ui_remotely_open_link(const char *); const char *ui_keyname(int); void ui_toggle_side_window(int); void ui_show_downloads_pane(void); blob - f33ac6e2ff2d8ffd5124950f2834896f3c0b6478 blob + a7af3cbb29c6bace3d7b3441edf2816dc9345e3c --- ui.c +++ ui.c @@ -1242,6 +1242,17 @@ ui_on_download_refresh(void) } } +void +ui_remotely_open_link(const char *uri) +{ + new_tab(uri, NULL, NULL); + ui_on_tab_refresh(current_tab); + + /* ring the bell */ + printf("\a"); + fflush(stdout); +} + const char * ui_keyname(int k) {