Live data from Hacker News

Benefits of using tmux – streamlining your development environment

blog.bugsnag.com

11–20 of 172 posts

Re: Benefits of using tmux – streamlining your development environment

#11

Earlier quoted context omitted.

I greatly prefer Terminal.app on OS X, very standards compliant and predictable; if a bit slow but iTerm2 is slow as well.

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

Re: Benefits of using tmux – streamlining your development environment

#12
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 do. Part of it is just that I'm so used to it from using it remotely that I feel at home using it locally as well. But it's also very portable. For instance, I can use it in macOS or even on Windows using the Ubuntu bash subsystem. This makes it effectively a universal tiled window manager for me.

Re: Benefits of using tmux – streamlining your development environment

#13
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 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 with the mouse if I want to. So I get the best of both worlds.

Surprise - I don't run tmux. It is simpler to have several roxterm, in these position, with various tabs open. When I work remotely, I use screen on the remote host, but that's all.

To give you an idea of my shortcuts, in a real life scenario ; my caps lock is remapped to control or escape with xcape:

- esc: pop a new roxterm and from wherever I am, bring me to the terminal desktop

- f9: resize this roxterm to the left part of the screen

- esc: pop another roxterm, focus it

- ctrl-f9: resize it to the right vertical slice of the screen

- f4: switch to the browser desktop

- f12: put by browser in full screen, to check some reference without distraction

- f5: switch back to the terminals desktop

- alt-tab: switch to the roxterm that's currently on the right

- f12: make this roxterm full screen to do something without distraction for a while

- f12: demaximize and put back this roxterm where it was

- f9: now move this roxterm to the left, over the other one

- alt-tab: move to the other roxterm that was on the left

- ctrl-f9: put this roxterm in the vertical slice position on the right

- ctrl-space: make this roxterm sticky, showing on all desktop

- f4: move back to the internet desktop to check more documentation

- f9: resize the browser to be on the left part of the screen, so that I can see both the browser and the roxterm

- f5: move back to the terminal desktop. The space occupied by the browser will be replaced by the roxterm I left there, on the left

- alt-tab: move focus to this roxterm

- ctrl-t: open a new tab in this roxterm

- ctrl-v : paste some stuff from the internet browser

(etc..)

I have accomplished all that with about 20 keystrokes, from muscle memory. When I connect my extra wide screen, f10 and f11 have similar windows resizing function as f9 do on the laptop screen. f1 to f8 take me to desktop dedicated to some use or another (f7 is the windows desktop, with visual studio, f6 is the rstudio desktop, etc)

One think I positively hated until recently: copy and paste. Muscle memory means ctrl-shift-c in one application and ctrl-c in another didn't work. So in the terminal, I remapped the sigint signals to ctrl-x with stty. Hitting ctrl-x is just as convenient as ctrl-c and now I can copy paste as needed. ctrl-v to enter verbatim sequences is done with ctrl-q, just like in vim. so ctrl-c and ctrl-v work everywhere.

When I catch myself wanting to use the x copy paste buffer, the middle click is not so hard: on a thinkpad keyboard, it is right below the space key. But I just prefer ctrl-v. The luxury of having 2 independant copy-paste buffers is appreciable for some tasks however :)

Anyway, sorry for the long reply. I just don't have a lot of opportunities to talk about my setup. I am some kind of an optimization freak, I know it. But I don't want an interface to bother me. I have been using that for the last 3 or 4 years after giving up on OSX, and it has one great quality: I don't have to think about it. It just work the way I want. YMMV of course.

Re: Benefits of using tmux – streamlining your development environment

#16

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

Not the same. An option for block selection (say using alt-click) would be a great addition to a terminal.

Someday I get sick of running such long lines I may code that for roxterm.

Re: Benefits of using tmux – streamlining your development environment

#18

The one reason why I would prefer tmux over screen is that it is possible to script it. AFAIK screen is much more difficult to script.

Screen has awful support for unicode. When people started using emoji a lot on IRC i swtiched so irssi would stop moji-baking.

Re: Benefits of using tmux – streamlining your development environment

#19
I use a tool called tummy (https://github.com/minhajuddin/tummy full disclosure: built by me) which allows me to create a Tmuxfile per project. A typical file looks like this:

  session "liveform"
  directory "/home/minhajuddin/r/liveform/frontend"

  window "src", [
    pane("vim TODO"),
  ]

  window "server-pry", [
    pane("puma --port 3000 --config 

Re: Benefits of using tmux – streamlining your development environment

#20
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…

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 buffers instead of tmux windows when editing a series of files.

I imagine using a tiling window manager with tmux you'd have a similar issue. Sshing into a box you can launch tmux and have windows and splits inside, but you couldn't use your WM.

Post reply on HN