fork of dequis/tmux-url-select
tmux-url-select is a perl script that lets you select URLs with the keyboard.
It integrates with tmux to capture the current pane buffer, switch to a window with highlighted links, and let you select the link you want to open/yank.
Optional and configurable:
xdg-open (can be any url opener or browser) and
xclip (for yank)
Place it somewhere in your path with name
chmod +x it.
Add this to your
bind some-key-here run tmux-url-select
Where some-key-here is any key you want to use to start url selection.
Personally I use "z" which is an unused keybinding that is really close to my
tmux prefix key (
bind z run tmux-url-select
Once you're inside tmux-url-select, keybindings:
jor down arrow: down
kor up arrow: up
9: select link by number
y: yank (copy to clipboard)
o: open link
O: yank or open link without closing
There's a bunch of constants near the top of the file, you can modify them to your liking.
use constant COMMAND => 'xdg-open %s'; use constant YANK_COMMAND => 'echo %s | xclip -i'; use constant SHOW_STATUS_BAR => 1; use constant VERBOSE_MESSAGES => 0; use constant TMUX_WINDOW_TITLE => 'Select URL'; use constant PROMPT_COLOR => "\033[42;30m"; use constant ACTIVE_LINK_HIGHLIGHT => "\033[44;4m"; use constant NORMAL_LINK_HIGHLIGHT => "\033[94;1;4m";
Probably should add some explanations. Maybe. For now just go ahead and experiment with stuff.
If a line with a link has a background color, it will get reset after the link. I have no idea how to do this without writing a parser of ansi escape codes or using ncurses properly, so I'm leaving it unfixed as a reminder that as humans we're all flawed in different ways.
Might flicker when selecting links because the whole screen is redrawn. It can't be helped. Works fine for me most of the time.
There used to be a section here about problems launching process but that should be fixed now.
Q: Why perl? It's dead and it sucks, cool kids use node.js nowadays.
A: It's fun. Fun things are fun.