top | item 40600454

(no title)

chrisamiller | 1 year ago

At any given time, I'm working on like 10 different projects. tmux lets me set up sessions for each of these projects, so that when I leave one and come back in a week, all the context is there (multiple windows, bash history, working directories I was in, etc)

Since I work with big biological data, most of my work takes place on our university cluster, which means my laptop is just a dumb terminal and all of the action takes place on the server. IME, tmux is especially powerful with coupled with mosh, which gives a persistent SSH connection. That means I can be in the middle of a project, close my laptop lid, go home, then later that evening, open my lid and everything is reconnected and just right there. Same if I reboot my laptop - one command to reconnect my terminal with mosh, and I'm back in the middle of my complicated multi-window project.

discuss

order

mipmap04|1 year ago

I used to work on CECL and stress testing models for large banks and i used tmux similarly. Lots of scripts that would take like 6 hours to run.

trentnelson|1 year ago

What happens when you press page up or down in tmux? Have you configured it to scroll page up & down? Or do you do that via Ctrl-B ] or whatever the magic incantation was?

donio|1 year ago

Not parent but keybindings are fully configurable. For example to scroll up with Shift-Pgup:

    bind -n S-PPage copy-mode -u
    bind -T copy-mode S-PPage send -X page-up
    bind -T copy-mode S-NPage send -X page-down
The first line is a top-level binding to enter copy-mode and immediately scroll up one page. The other two add bindings within copy-mode so you can continue to scroll up or down with those keys.

I also have a small hack in my .zshrc to start scrolling up with `M-v` (like in Emacs) while at a shell prompt:

    tmuxup(){tmux copy-mode -u}
    zle -N tmuxup
    bindkey '^[v' tmuxup

necrotic_comp|1 year ago

That's right. You have a prefix that lets you use page up page down in any pane you've got currently selected.

Izkata|1 year ago

> Ctrl-B ] or whatever the magic incantation was

This is something tmux inherited from screen, but it from a quick test it looks like they didn't copy the whole thing? You use [ to enter this mode (it's actually for copying text, not just scrolling) and in screen use ] to exit without copying anything. Looks like tmux doesn't have ], at least by default?

elteto|1 year ago

When I used tmux I used to set Ctrl-PgUp/Down bindings to scroll the buffer.

flobosg|1 year ago

Ctrl-B PgUp/PgDown enters scroll mode.

flobosg|1 year ago

Similar use case here, but in a biotech company.