-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL opening multiple times #5
Comments
I believe I stumbled upon this issue too.
Until I fixed it, tmux-url-select used to open each link twice (resulting in two separate tabs showing the same URL). I have investigated the issue further and here are my conclusions so far:
tmux-url-select/tmux-url-select.pl Lines 135 to 138 in 3665185
This "something else" can be the next browser (likely what happened to @crater2150) or running $BROWSER again (what happened to me). Consequently, I suggest the following fix: --- tmux-url-select.pl
+++ tmux-url-select.pl
@@ -134,6 +134,9 @@
unless (fork) {
tmux_display_message($message) if VERBOSE_MESSAGES;
+ open(STDIN, '/dev/null');
+ open(STDOUT, '>/dev/null');
+ open(STDERR, '>/dev/null');
exec $command;
}
} I hereby confirm that toggling this 3-line fix toggles the issue. |
I recently installed another browser and set it as default, since then tmux-url-select opens each url in both browsers. Opening an URL from somewhere else or directly using xdg-open does not show that behaviour, it only opens in the one I set as default.
I found a workaround, I changed
COMMAND
from xdg-open to a script with the following content:Notably, redirecting the output is required. If I don't, tmux-url-select will again open the link in both browsers. I redirected to files to check, if there are any errors in the output, but stdout was empty and stderr contained "09:56:49 INFO: Opening in existing instance". So a nonempty stderr seems to cause the problem.
The text was updated successfully, but these errors were encountered: