Hacker News new | ask | show | jobs
by pyrhho 5269 days ago
I keep having this nagging feeling I should use tmux more often. Right now I use it for remote pairing type stuff, but I can never bring myself to use it regularly. I love tmux, and it's super useful, but I just can't deal with the way it breaks scrolling. tmux and screen both horribly break scrolling and reverse searching. I'm not sure what the fix is, but until that works I can't see myself using it regularly.
2 comments

CTRL+B (or whatever key to get into tmux mode input) then Page Up/Down to scroll or keyup/down. Then just esc when you are done scrolling.

Works fine here, havent needed to mock with settings to make it work like this. But the tildas scrollbar is broken by tmux, and the usual shift+pageup, and mousewheel to scroll... but thats okay.

> [...] but thats okay.

Agree to disagree, I suppose...

How do you do reverse search, though? Any replacement for ITerm's Ctrl-F?

When you're in copy-mode (activated by prefix-[ also prefix-pgup as mentioned above) search is like vi or emacs depending on your copy-mode (vi by default I believe).

SO: / to search down, ? to search up. If you want to search from the top down, hit "g" in copy-mode to go to the top of the buffer (in vi mode). "G" to go to the bottom.

These, especially /, are really common conventions. / is used for search by vi, less, Opera (Firefox now too I think), even twitter.com.* My point is that / and ?, and to a lesser extent g/G/etc. soon becomes second nature and are worth learning because they are so common. How do you search backwards from the bottom in iTerm?

See "copy-mode" for more info http://www.rootr.net/man/man/tmux/1

*twitter.com (as well as duckduckgo.com and to a limited extend slashdot) uses some sweet vi keybindings. Try n, j, k, r, etc.

CTRL+R ? Like normal. Is iTerm another iProduct? Never used macosx, wouldn't know.

All terminals (GNU/Linux) Ive used tmux on, ctrl+r works, and scrolling as described in previous post.

"setw -g mode-mouse on" in your tmux.conf will let you use the mouse for scrolling and selecting text once you're in copy mode.
Here's how to make shift-pgup/pgdn work in screen:

    echo "termcapinfo xterm ti@:te@" >> ~/.screenrc
Awesome, I will give this a try, thanks!