Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You do one better - tmux's mouse mode allows you to scroll with your mouse wheel.

Just add 'set -g mouse on' to your ~/.tmux.conf. You can configure the history size limit by setting 'set-option -g history-limit <lines>'. When you scroll the mouse wheel, tmux will enter copy mode and scroll.



The problem is, my terminal already has a concept of scrolling, and its own concept of a buffer, with its own concept of keeping unlimited contents based on available memory, etc.

I've never seen a tmux setup that doesn't fail horribly when these two concepts collide (I can't cmd-f search the buffer for interesting things, I don't get a scroll bar on the right that shows me how far up the buffer I am, scroll acceleration doesn't work, etc.)

Terminal.app already does split panes, tabs, scroll acceleration, search, etc. I don't get persistence, but I don't really understand the workflow where you'd want it. I typically open new tabs exactly because I want a fresh workspace, and I close them exactly because I want to clear my workspace. I can just manually call tmux when I know the thing I'm running should outlast a window (and actually, 99% of the time that's on a server I'm SSH'd into, not on my local machine.)

Can anyone convince me why I need to be all-tmux all-the-time?


>The problem is, my terminal already has a concept of scrolling, and its own concept of a buffer, with its own concept of keeping unlimited contents based on available memory, etc.

Perhaps try iTerm2 (for Mac) native tmux integration. You can have tmux panes and split panes that are (and behave like) regular terminal panes and tabs.


That program is so disgustingly good it was almost the sole reason I bought this generations macbook pro.

If any terminal emulator programmers are listening cough konsolecough please consider following the same method of integration <3


"You can have tmux panes and split panes that are (and behave like) regular terminal panes and tabs."

What's the advantage of that exactly?


Proper fucking scrolling?

Less terminal behavior that needs to be multiplexed by tmux?

More integration with other iTerm features (instead of tmux panes being agnostic to them)?


Sessions are the killer feature for me. I have a session for each project I work on and can have all my tabs, panes, vim, etc set up and switch between them at any time. Sessions can be persisted so that even if I reboot my machine all my project workspace configurations are saved and ready to go.


How do you persist sessions between reboots?


I haven't used it, but there's a plugin which allows for this behavior: https://github.com/tmux-plugins/tmux-resurrect


The session doesn't actually persist between boots. I think what the parent must be referring to is the ability to create tmux session configurations. Then after a reboot if you try to connect to the session which no longer exists the conf will spin it up for you.


Gotcha. I'll have to look up some docs on that, sounds useful.


Yeah, I use https://github.com/tmux-plugins/tmux-continuum to auto save sessions, and https://github.com/tmux-plugins/tmux-resurrect to restore them when tmux is started.


I disable my Terminal.app buffer. If not in tmux, can't scroll back. All scrolling and copy and pasting is done with tmux. Also use vi keybindings so I select text and copy using same keys in vim and tmux.


That is absolutely not 'better', sorry. Taking your hands off the keyboard to do something basic is never better.


I disagree. I want to select with the mouse and touch type with the keyboard.

And "doing it faster" is never a concern. As a programmer I write about 5% of what I could type in the same time as a secretary or accountant. Most of the work is thinking.

Plus, the occasional chance to get your hands off of the rigid (and carpal tunnel inducing) pose on the keyboard and move them to the mouse, or vice versa, is welcome.

I don't want to replicate things the mouse does better with keyboard shortcuts, or suffer "modal" input-modes in my programs.


k

I still prefer not using the mouse for a basic operation like scrolling, thank you.


I myself prefer to scroll with the keyboard in tmux, but for moving the cursor and selecting text, tmux has a very, very long way to go before being optimally efficient and useful in this regard.

The kings of keyboard-based cursor movement and text selection are vim and emacs, both of which have a very rich and powerful toolbox of techniques and plugins that help the user do that quickly and efficiently.

For example, emacs has plugins like ace-jump-mode which lets you jump the cursor to any precise position on the screen by typing just one or two keystrokes. vim has similar plugins, like easy-motion and precisejump.

vim and emacs also have quick ways to select words, sentences, paragraphs, functions, lines, logical and visual blocks, the entire document, etc. This includes having full access to rich and powerful regex text matching, which can be used for selection.

In contrast to emacs and vim, when I try to move my cursor and select text in tmux, I feel crippled. So sometimes I do succumb to the temptation of using the mouse to select text in tmux, despite being quite comfortable and satisfied in using the keyboard exclusively in vim and emacs.


I can still navigate the scrollback in tmux with my keyboard, I just prefer not to.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: