2

I have a problem with opening very long URL in tmux. In my case the URL is longer than a line and tmux break it into multiple lines. However when I use mouse to click on the URL, it only opens the first line of the URL and ignore the rest.

I am just wondering how I can change my tmux config to support this use case.

iampat
  • 121

1 Answers1

2

It actually depends on how exactly your URLs appears on the screen.

If you just print out the lines as it naturally happens (e.g. with cat command), the lines get joined and the URLs can actually be clicked.

However, if you use vim or less or another viewer, they try to show the text line by line and it's actually the software to break the lines.

With less, the action that helps is: scroll back one screen with b and forward with space.

With vim something like :w !cat can help.

In other words, you should think of a way to just naturally print the URL so that it would wrap over the screen border.

Needless to say, your screen should occupy the full terminal width, i.e. not split vertically.

To temporary remove all other panes, there's 'zoom' for panes in tmux: activated by C-b z.

  • For some folks Prefix may be Ctrl+A or Ctrl+Space, but the 'zoom' for panes is the workaround I use the most as well.

    Another trick from a tmux plugin for handling URLs and text is to highlight what you can on the first line in copy mode, then hit e until the rest of the URL is highlighted, then you can yank Enter and open using xdg-open the URL after pasting with Prefix+p (if mapped). https://github.com/tmux-plugins/tmux-copycat/issues/59

    – dragon788 Jan 25 '18 at 18:26