Live data from Hacker News

Benefits of using tmux – streamlining your development environment

blog.bugsnag.com

81–90 of 172 posts

Re: Benefits of using tmux – streamlining your development environment

#81
post #40
post #20

Earlier quoted context omitted.

Similar to that, I've seen a lot of blog posts about Tmux and Vim, but I've been itching to see one where they talk about day-to-day. When do they use vim-split versus tmux pane, vim buffers versus tmux windows? I use both, but aren't very systematic...there's a bit of cognitive load when remembering which I'm using and using the different commands to navigate. You can't do diffs with panes and it's nice to use vim b…

What I do, and would recommend, is spin up vim or emacs as a daemon, then connect to it as a client in one or more tmux windows. That way, you can yank/put easily using the usual shortcuts from any tmux window to any tmux window. Then, it's usually easiest to only use intra-process pane splitting (keeping it all in vim or emacs) unless you need to do something that doesn't follow a perfect division, like: top half vi…

Interesting to run it as a daemon and connect. I'd be curious to see how you set it up and use it in practice. Whenever I use vim splits I'm almost always diffing left and right. So, nothing fancy.

Re: Benefits of using tmux – streamlining your development environment

#82
post #9

Does anyone run tmux with a tiling window manager for local development? If so, what are the advantages? I know automating sessions is one of them, as explained in the article. I am more interested in hearing about interactions with the terminal. You already get good mouse-less window management with something like i3 or xmonad. How about copy & paste? I use urxvt plugin for this, but I often find myself using the mo…

I'm writing an i3/tmux integration similar to iTerm2's[0], but working at the WM layer, using i3 and urxvt.

The reason I'm doing this is that I'm often ssh'd into a box, and having to ssh into multiple terminal is a chore. I often create a spontaneous term that I close after a couple of minutes. Being able to have a dedicated ssh'd workspace where every split is ssh'd into the box would be a godsent.

This would also fix the mouse integration and various other things that annoy me with raw tmux.

[0]: https://www.youtube.com/watch?v=nGhfE9n1RLo

Re: Benefits of using tmux – streamlining your development environment

#83
post #76

Earlier quoted context omitted.

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

killall and pkill don't work if the thing I'm trying to grep for isn't the first word of the process string. Let's say I'm trying to kill 'python foobar.py' but I don't want to kill 'python bazquux.py'. The only thing it'll respond to with killall is 'killall python', but then both of them will respond. So I have to grep out the parameter and then kill that, with: ps -ef | grep 'foobar.py' | awk '{print "kill -9 " $2…

[deleted]

Re: Benefits of using tmux – streamlining your development environment

#84
post #9

Does anyone run tmux with a tiling window manager for local development? If so, what are the advantages? I know automating sessions is one of them, as explained in the article. I am more interested in hearing about interactions with the terminal. You already get good mouse-less window management with something like i3 or xmonad. How about copy & paste? I use urxvt plugin for this, but I often find myself using the mo…

Since I can't use a tiling window manager everywhere, I do the next best thing: I have a set of key configs for most platforms that gives me (mostly) uniform control over windows, and then use the local terminal emulator with tmux inside.

I use Moom on the Mac with hotkeys that match the Windows left/right-side tiling, and a custom OpenBox config[1] that matches those too:

https://github.com/rcarmo/docker-templates/blob/master/deskt...

Then on the Mac I usually use the native Terminal (I keep trying to switch to iTerm, but most of the performance issues Terminal had have been ironed out by now), on Linux I usually use lxterminal, and on Windows I either use Cygwin's mintty or (more recently) wsltty to interact with Bash for Windows:

https://github.com/mintty/wsltty

(even though I'm a Microsoft employee, I strongly dislike the "feel" of the standard console and the way it handles both fonts and copy/paste, so I seldom use it at all)

I also tried various hacks to do raise on hover and suchlike, but I found that some things were best left "native" and get along OK with these bare mouseless window management hotkeys.

Incidentally, tmux has a growing following among my colleagues (there are a lot of Microsoft folk getting to grips with Bash and SSH these days, so when I tried to pass on some best practices, tmux was right at the top of the list)

Re: Benefits of using tmux – streamlining your development environment

#85
post #74
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…

I was able to work out pasting into tmux from the system buffer, but no solutions I've seen for copying out of tmux have ever worked for me. So yes, that's a pretty basic usability issue.

Hold option, select the text you want to copy, CMD/CTRL+C.

Re: Benefits of using tmux – streamlining your development environment

#86
post #76

Earlier quoted context omitted.

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

killall and pkill don't work if the thing I'm trying to grep for isn't the first word of the process string. Let's say I'm trying to kill 'python foobar.py' but I don't want to kill 'python bazquux.py'. The only thing it'll respond to with killall is 'killall python', but then both of them will respond. So I have to grep out the parameter and then kill that, with: ps -ef | grep 'foobar.py' | awk '{print "kill -9 " $2…

Check out -f parameter of pkill.

Re: Benefits of using tmux – streamlining your development environment

#87
post #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.

I didn't ask a question, I know how to fix the issues.

Re: Benefits of using tmux – streamlining your development environment

#88
post #9

Does anyone run tmux with a tiling window manager for local development? If so, what are the advantages? I know automating sessions is one of them, as explained in the article. I am more interested in hearing about interactions with the terminal. You already get good mouse-less window management with something like i3 or xmonad. How about copy & paste? I use urxvt plugin for this, but I often find myself using the mo…

I use screen rather than tmux but the principal is the same.

I have set things up so that I maintain separate screen sessions per context, including separate shell histories (the single biggest win, by far), separate shell defaults, aliases, etc.

Re: Benefits of using tmux – streamlining your development environment

#89
post #81
post #40

Earlier quoted context omitted.

What I do, and would recommend, is spin up vim or emacs as a daemon, then connect to it as a client in one or more tmux windows. That way, you can yank/put easily using the usual shortcuts from any tmux window to any tmux window. Then, it's usually easiest to only use intra-process pane splitting (keeping it all in vim or emacs) unless you need to do something that doesn't follow a perfect division, like: top half vi…

Interesting to run it as a daemon and connect. I'd be curious to see how you set it up and use it in practice. Whenever I use vim splits I'm almost always diffing left and right. So, nothing fancy.

Definitely. If you shoot me an email (hello@tedkornish.com) I'll let you know when the post is up. As a disclaimer, I use emacs with evil mode, not vim proper, so the command is just

  emacs --daemon=myproject
Then it's just

  emacsclient -nw -s myproject ./directoryhere
to connect, and the first part of that can be aliased away. Not 100% sure that vim has a good daemon/client mode, but I seem to recall something existing along those lines. It can be extremely useful to have multiple collections of editor panes set up, each in a different part of the codebase, and the ability to switch back and forth quickly with tmux - really helps for debugging and keeping organized.

Re: Benefits of using tmux – streamlining your development environment

#90
post #9

Does anyone run tmux with a tiling window manager for local development? If so, what are the advantages? I know automating sessions is one of them, as explained in the article. I am more interested in hearing about interactions with the terminal. You already get good mouse-less window management with something like i3 or xmonad. How about copy & paste? I use urxvt plugin for this, but I often find myself using the mo…

I'm writing an i3/tmux integration similar to iTerm2's[0], but working at the WM layer, using i3 and urxvt. The reason I'm doing this is that I'm often ssh'd into a box, and having to ssh into multiple terminal is a chore. I often create a spontaneous term that I close after a couple of minutes. Being able to have a dedicated ssh'd workspace where every split is ssh'd into the box would be a godsent. This would also…

This would be great if you get it working. I don't suppose you've got a link for what you've got so far in git or anything? I only make basic use of tmux because I'm more comfortable with i3 key bindings.
Post reply on HN