Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh : launch tmux in just one terminal




I wrote a program that jumps my mouse pointer from one terminal to the
next via hotkeys.  Yeah, when you're in terminal mode, having to reach
for the mouse just to move from one to the other is really annoying.
Sounds like tmux handles this itself, but will it jump between
monitors?  And my program works regardless of the running applications
so whereas it mostly for use in terminals I can jump between, say a
browser and my email too.

You can have multiple tmux sessions on one computer. So you culd dedicate terminal "A" to tmux session "A" and have terminal "B" show tmux session "B" and just use hot keys to switch between them like you currently do.

And tmux is fully scriptable. So let's say you want to send a command from one pane in session A to another pane in session B, you can do this with a tmux hotkey without even leaving the current terminal. It's very powerful. I've used feature when I do testing. I'll punch a key and it will test the code in the current pane in a completely different terminal window running in a different tmux session.

I'm on a mac and I use iterm, which is just a terminal with more bells and whistles. I have two monitors. I typically have 3 terminal windows open: a vim session open for taking notes, a zsh session for running taskwarrior commands, and one with tmux open for all my coding and server administration. Within the session, you can have multiple windows. I like to use windows for my different projects. So if I want to switch to project "A", I hit a tmux hot key to jump to window "A" and all the important files are right there, already open in vim and ready for editing. Each file is in its own tmux pane, which is running it's own separate shell.

At any rate, my notes and tasks are on one display, the tmux session is full screen on the other. I use simple hot keys to change focus from one terminal window to the other. For other applications like my browser, I have hotkeys for those as well.

Well, that's probably more than you wanted to know. Like with anything, only you can decide if using tmux is worth the investment of time in learning it. If this is what you do for a living, then yeah, you should definitely look into tmux as it will likely pay off. If you're more of a casual user and just like puttering around on your computer for fun are writing simple scripts and issuing a few dozen commands here and there over the course of a day, it's probably overkill.





Messages sorted by: Reverse Date, Date, Thread, Author