6 ms·
Workflow in tmux
- swah 14y agoOT: Tmux/Screen are a little bit RSI inducing to me, to be used effectively. Any tips?
- vec 14y agoRemap caps lock to be a ctrl key, then preferably remap your prefix key to a. Caps+a is way easier to type.
- s00pcan 14y agoThis is also what I do.
- base698 14y agoI do ctrl+o because I hated having to hit ctr+a two times to go to the beginning of the line in console apps.
- barkmadley 14y agoI would find Caps+a very difficult to type (since it uses the two weakest fingers). Have you ever tried Caps+d or Caps+f?
- marshray 14y agoCtrl+L is good because it's on the home row and typically used for uninteresting stuff anyway (like refreshing the terminal window). My sequence to actually refresh the window is "Ctrl+L L"
- tjdetwiler 14y agoRSI?
- cjh_ 14y agohttp://lmgtfy.com/?q=RSI http://lmgtfy.com/?q=RSI
- tjdetwiler 14y agoResidential Services, Inc?
- rbright 14y agoFor tmux, I assign the bind-key to backtick (`) and last-window to TAB. Then do most of my work in window #1. On a US keyboard, I find it pretty easy to move between windows with `1, `2, `TAB, etc.
- nviennot 14y agoUse the Alt key to navigate around: https://github.com/nviennot/tmux-config https://github.com/nviennot/tmux-config
- cjh_ 14y agoIt may just take a bit of work to make sure that the important tmux keybindings don't clash with those of the applications you will be running.
- greghinch 14y agoI somewhat agree, and the suggestions from others are good, but something that also is a big help with RSI: take more breaks. I have a script set up to remind me to take a break every hour, and it dims my monitor for 10 minutes each time. That has made the largest difference for me.
- tomsthumb 14y agoRemap your keys. Capslock makes for a very nice control key, cause really, that's the single most used modifier/power key that gets used aside from maybe shift. You can also remap the "lead-in" character. I use ^j on both screen and tmux (tmux isn't on our prod servers). This frees up ^a in screen so ^a can send me to the beginning of a line, which is quite nice as I write a lot of long commands and it works in several different programs. It's just a really easy combo to hit that avoids chording or stretching your hands to do something like that constantly. My right hand does not hit the 'b' key for squat. Honestly, a lot of stuff is configurable so that with some thought and planning (and knowledge and research) you can relieve a lot of weird movements with your hands.
- base698 14y agoTo get copy/paste to play nice in OSX you have to go through some Herculean tasks. I made it work with netcat yesterday. I was running an http server to do it :) https://github.com/base698/tmux-copy-paste-mac-osx https://github.com/base698/tmux-copy-paste-mac-osx
- illicium 14y agoWhat's wrong with using reattach-to-user-namespace?
- base698 14y agoIt involves compiling native code and its easier to do with a shell script?
- chirayuk 14y agoI know what you mean. I translated that to a python script a while ago for myself so I could stick it on other boxes without having to compile it. It's now a gist – https://gist.github.com/chirayuk/5377283 https://gist.github.com/chirayuk/5377283
- jfb 14y agoI'd much rather run the native code, if my other option is firing up an interpreter. Shrug.
- rhapsodyv 14y agoI gave up of tmux. Now I just use iterm2 split pane. It's working fine for me.
- bryogenic 14y agoYou may not realize it but iterm2 is using tmux for its split panes. :)
- rane 14y agobind C-y run-shell "reattach-to-user-namespace -l zsh -c 'tmux saveb - | pbcopy'" works for me.
- bryogenic 14y agoI really like the status bar with the arrow-breadcrumbs look. I will definitely be incorporating that into my config. If others are looking for a great config to start out with definitely check out Brian P. Hogan's tmux: Productive Mouse-Free Development [1]. It is a great quick intro to tmux that demos and steps through the creation of a great tmux.conf [1] http://pragprog.com/book/bhtmux/tmux http://pragprog.com/book/bhtmux/tmux
- th 14y agoThe status bar with the arrow breadcrumbs is powerline: https://github.com/Lokaltog/powerline https://github.com/Lokaltog/powerline There are bindings for tmux, bash, zsh, vim, and ipython (among others).
- eridius 14y agoThe status bar with the arrow breadcrumbs _looks like_ powerline. If you read his tmux config, he's not actually using powerline, he just duplicated the appearance.
- th 14y agoHe is using the vim-powerline bundle for vim, but it looks like you're right about the tmux config.
- sathish316 14y agotmux has its own powerline: https://github.com/erikw/tmux-powerline https://github.com/erikw/tmux-powerline
- jaredmcateer 14y agoActually that's been deprecated in favour of the one powerline to rule them all that "th" posted above.
- Osiris 14y agoI understand using console window managers when logged into a headless system where you don't otherwise have access to a UI, but I'm baffled by the desire to use console-based window managers within well defined GUI like OS X. In OS X, there are multitudes of tools to allow you to manage windows. Spectacle is a simple one, Slate is extremely customizable. Why not use the built-in OS X window manager to manager various windows rather than a console-based one? If you say the advantage is the shortcut keys, Slate lets you setup shortcut keys to do just about anything. Can anyone give me a list of pros/cons for using a console-based window manager over a native one?
- joelhooks 14y agoit is lightweight, contained, and excellent if you have a "unix-like" workflow. Typically I'll have a watch script, server, and vim in a given window, and it is super compact. Some cons are probably the learning curve required to see any advantage, and the fundamental lack of any respect for mousing, which can be in the pro column for many.
- Osiris 14y agoThat's interesting. I practically never use the mouse to switch between windows in OS X or Windows. The biggest problem I have with tmux is vertical splits don't work with native copy-paste because the selection goes across both panes. Using multiple terminal windows, on the other hand, doesn't have that issue.
- rogerbinns 14y agoThe single most irritating thing about tmux is that viewers have to look at the same window or whatever it is called. My typical usage pattern is to connect twice, have one window where there is a long running task I want to monitor and a second where I am typing commands. But I can't show one in one connection and the other in the other connection. Note that I use byobu to front end things, and when using screen this can easily be done. I have seen workarounds that involve using multiple copies of tmux talking to each other in various heroic configurations but that is silly.
- piinbinary 14y agoI always have two copies of tmux running, for this very reason. Someone out there surely must have a better solution.
- pyre 14y agoI used to do this all of the time in screen, but I haven't done so since switching to tmux (haven't run upon the situation). You've inspired me to look into it. First, terminology. I know that tmux has: servers, clients, windows, sessions, and panes, but I've never bothered to understand how they fit together. * server - The server is a process that listens on a unix socket, and accepts connections from clients. Each server manages one or more sessions, which is a grouping of windows. * client - A terminal connected to the server. Each client connects to a single session on the server. * session - A collection of windows on a server. Each session has a single 'active window.' When you connect two clients to a single session, switching the current active window affects what both clients see. Solution: Windows can be shared between sessions, and a single window can be present in multiple sessions. This culminates in a tmux feature called "grouped sessions" where multiple sessions are linked and share the same windows. You can use this command: tmux new-session -t session-id source: http://unix.stackexchange.com/questions/24274/attach-to-different-windows-in-session http://unix.stackexchange.com/questions/24274/attach-to-diff...
- rogerbinns 14y agoThis is so much more complicated! When using byobu I use F3 and F4 to cycle to previous and next window. I can't understand why they think that by default I want all of the viewers to switch at once.
- d0m 14y agoI started using tmux.. then switched to stumpwm which is too awesome to explain here. Embrace the full power of emacs and your Window Manager.
- eridius 14y agostumpwm is a window manager. tmux is a terminal multiplexer. They are not the same thing and using one does not preclude using the other.
- d0m 14y ago*Started using tmux, then realized for my needs stumpwm was better. Obviously these are two different beasts. I still often use tmux on remote server for instance. However, if you use tmux locally, then a tiling manager might be better.
- pimeys 14y agoExactly. I've been using xmonad for years now and I've tried to start using tmux for several occasions. I've never found any advantage of it compared to my different xmonad layouts: tabbed, tall, tall mirrored and grid.
- blaabjerg 14y agoWhy not both? If you use tmux for your terminals you get persistence in case you need to restart X, or when you log in remotely.
- LiveTheDream 14y agoIs there a way (short of writing a script) that will allow me to shuffle windows left and right, and/or move a window and slide the rest down? Imagine having windows A, B, C, and D respectively in positions 0, 1, 2, and 3. I'd like to move D into position 1 so they end up in this order: A, D, B, C. Haven't figured out how to pull this off yet.
- lucastx 14y agoI do it like this: bind-key ) swap-window -t + bind-key ( swap-window -t - So "<prefix> (" swaps the active window with the one on its left, and "<prefix> )" swaps it with the one on its right. It seems to be what you want.
- LiveTheDream 14y agoThat works beautifully! Thank you.