Live data from Hacker News

Benefits of using tmux – streamlining your development environment

blog.bugsnag.com

61–70 of 172 posts

Re: Benefits of using tmux – streamlining your development environment

#61
post #17

Looks like a nice .tmux.conf. Wonder if it's online anywhere.

From the author's GitHub repository: https://github.com/keeganlow/dotfiles/blob/master/.tmux.conf

Long time tmux user.

Thanks for posting the .tmux.conf link. Modified the window decorator line as sometimes you can't always tell which pane you are in:

set-option -g set-titles-string '#(whoami)@#H session: #S window: #I-#W pane: #P'

Also noticed that the status right only updates the time if you perform a tmux op.

Re: Benefits of using tmux – streamlining your development environment

#62
To me tmux, like a lot of tools, suffers from bad defaults that makes it less enjoyable to use. One example is not being able to scroll with a mouse. I usually find someone's tmux.conf online and use it, but always run into strange problems that I don't have the energy figuring out. My current conf suffers from the navigation bar going completely black when I try to rename a pane (can't see what i'm typing).

Really wish more tools took care into making solid defaults and not assuming all users are like the ones on their mailing lists.

Re: Benefits of using tmux – streamlining your development environment

#63
I've used screen for darn near 20 years now. Have tried to switch to tmux, but even with screen-like keybindings, I end up running into something[0] that makes me switch back because screen is just muscle memory for me at this point.

[0] like switching to a non-existent-numbered screen to get a list of which ones I do have...

Re: Benefits of using tmux – streamlining your development environment

#65

Earlier quoted context omitted.

iTerm's killer feature for me is the special paste modes - it is trivially easy to do things like visually select a block of processes numbers from ps and then paste that block as a space-delimited list on one line to kill them, etc. Terminal.app is fine for most things but can't do stuff like this.

ps aux | grep 'thing' | grep -v grep | awk '{print $2}' | xargs kill

My own version of that command:

    ps -ef | grep 'thing' | awk '{print "kill -9 " $2}' | sh
On most of my systems, I tend to make a shell script out of it and usually save it to /usr/local/bin/kll (and I don't care about grepping out grep because it doesn't seem to affect anything).

Re: Benefits of using tmux – streamlining your development environment

#66

If you use tmux and vim, and if you run tests, then you must look at janko-m/vim-test and vim-dispatch. Runs any test seamlessly in the background. Vim-dispatch also has the best intro video to anything ever ;) https://vimeo.com/63116209

Tim Pope is awesome. I was just staring and grinning at the end. :)

Re: Benefits of using tmux – streamlining your development environment

#67

When I was first introduced to tmux, I was really excited by having a terminal session I could reattach to. I was never able to get very deep into it though: (1) a lot of the time a single script would get me up to speed, (2) the extra layer of abstraction broke some stuff I was doing, and (3) I couldn't make heads or tails of a lot of the tmux documentation. I'll definitely take a second look at a lot of the things…

Half a dozen commands will get you 90% of the way there. After you've run tmux: ctrl+b followed by... % - split pane vertically " - split pane horizontally arrow keys - change pane you're typing in :new-window 2 - switch to window 2 x - kill pane d - detach Command line arguments: tmux list-sessions tmux attach #will attach to last session by default tmux attach -t0 #will attach to session 0

A nice and convenient shortcut for:

tmux list-sessions

tmux ls

Re: Benefits of using tmux – streamlining your development environment

#68
post #24

Earlier quoted context omitted.

I do that, not in a real "tiling window manager" but something very close: openbox, set to show no titlebars, and using shortcuts to title the windows to precise positions. I have 3 position: most of my screen on the left, a small vertical slice on the right, a smaller chunk underneath. If I want a titlebar for some application, I have a shortcut that will give the window a titlebar, and then I can move it around wit…

Thanks, this is very interesting. I agree one of the major pain points of X11 systems, terminals, etc is the clipboard. So many different concepts and shortcuts across programs. I use xmonad, urxvt or xterm, emacs-nox and vimperator. I'm trying to make all them consistent. Perhaps the last thing to polish in my setup.

Not ideal, but the best solution I've found so far for moving text between the command line and other applications in urxvt is setting Bash to vi mode and then using visual mode for yanking/putting. I have Vim as my $EDITOR, which is opened when entering visual mode (I believe opening the editor is default Bash behavior). Vim is set to use the system clipboard ("set clipboard=unnamedplus" in the .vimrc) so from there I can bus text to/from other applications.

Dealing with stdout/err is another beast...

Re: Benefits of using tmux – streamlining your development environment

#69
post #65

Earlier quoted context omitted.

ps aux | grep 'thing' | grep -v grep | awk '{print $2}' | xargs kill

My own version of that command: ps -ef | grep 'thing' | awk '{print "kill -9 " $2}' | sh On most of my systems, I tend to make a shell script out of it and usually save it to /usr/local/bin/kll (and I don't care about grepping out grep because it doesn't seem to affect anything).

grrr....

    pkill thing

    killall thing
And then there's also pgrep instead of ps | grep

Re: Benefits of using tmux – streamlining your development environment

#70
post #62

To me tmux, like a lot of tools, suffers from bad defaults that makes it less enjoyable to use. One example is not being able to scroll with a mouse. I usually find someone's tmux.conf online and use it, but always run into strange problems that I don't have the energy figuring out. My current conf suffers from the navigation bar going completely black when I try to rename a pane (can't see what i'm typing). Really w…

Won't be able to answer all your questions but to enable your mouse scroll add the following to your .tmux.conf

    set -g mouse on
Likewise, to select from mouse you probably need to press "Shift" in Linux or "Fn" in Mac.

I've had more issues with Mac than in Linux with tmux tbh.

Post reply on HN