News for hackers. Stuff that matters.
Re:Benefits of using tmux – streamlining your development en... by partycoder on Tuesday November 08, 2016 @02:54PM (#12903401)
iTerm2 has integration with tmux. Much better than the default Terminal shipped with macOS.
Re:Benefits of using tmux – streamlining your development en... by erronjason on Tuesday November 08, 2016 @03:10PM (#12903514)
While it's better than the default terminal, iTerm2's tmux integration has always felt weak contrasted to the advantages of tmux. I've used tmux for the past four years as my main environment, and was totally psyched to hear they were integrating it into iTerm2. But when I began digging into it, little from my workflows translated to the "integration" provided by iTerm2. While it's a great feature of iTerm2, I find myself just using regular old tmux instead.

What features of the tmux integration do you utilize in iTerm2?

And for sitting through this, here's how to remap the default tmux hotkey: https://github.com/erronjason/dotfiles/blob/master/.tmux.con...

Re:Benefits of using tmux – streamlining your development en... by CJefferson on Tuesday November 08, 2016 @03:22PM (#12903594)
I mainly like it because scrollback works in the GUI.
Re:Benefits of using tmux – streamlining your development en... by pfranz on Tuesday November 08, 2016 @04:07PM (#12903946)
That's one frustration I have with Tmux. I want mouse scrollback, but don't want the other mouse controls. If I remember correctly I would accidentally go into copy-mode when I click-dragged my mouse by accident.
Re:Benefits of using tmux – streamlining your development en... by erronjason on Tuesday November 08, 2016 @04:18PM (#12904015)
That's the largest gripe I've had. Eventually, I got used to not relying on GUI scrollback - that actually sped things up for me. In a pinch I just `hotkey, [` to activate scroll, then just use my mouse or page-up & page-down. Even if you don't use tmux, get used to piping anything you'd want to read through `less`. It'll speed your workflow up.
Re:Benefits of using tmux – streamlining your development en... by CJefferson on Tuesday November 08, 2016 @04:43PM (#12904217)
I do use less sometimes, but sometimes I want to double check a command I typed a shirt while ago, or a command ends up outputting slightly more than I expected.

What I really want us an intelligent terminal, which attaches programming output to the program which produced it, let's me fold up long outputs, easily escape a long running program and store it output in a buffer for later checking, etc. But that seems annoyingly impossible.

Re:Benefits of using tmux – streamlining your development en... by microcolonel on Tuesday November 08, 2016 @03:00PM (#12903442)
I greatly prefer Terminal.app on OS X, very standards compliant and predictable; if a bit slow but iTerm2 is slow as well.
Re:Benefits of using tmux – streamlining your development en... by kellyjprice on Tuesday November 08, 2016 @03:18PM (#12903560)
I believe I get less lag in xterm within an Ubuntu VM than with iTerm2.
Re:Benefits of using tmux – streamlining your development en... by sethhochberg on Tuesday November 08, 2016 @03:07PM (#12903494)
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.
Re:Benefits of using tmux – streamlining your development en... by mi100hael on Tuesday November 08, 2016 @03:38PM (#12903701)

    ps aux | grep 'thing' | grep -v grep | awk '{print $2}' | xargs kill
Re:Benefits of using tmux – streamlining your development en... by devereaux on Tuesday November 08, 2016 @04:00PM (#12903886)
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 en... by amyjess on Tuesday November 08, 2016 @05:26PM (#12904513)
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 en... by partycoder on Tuesday November 08, 2016 @05:32PM (#12904555)
grrr....

    pkill thing

    killall thing
And then there's also pgrep instead of ps | grep
Re:Benefits of using tmux – streamlining your development en... by amyjess on Tuesday November 08, 2016 @05:42PM (#12904617)
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}' | sh

Re:Benefits of using tmux – streamlining your development en... by skovorodkin on Tuesday November 08, 2016 @06:01PM (#12904723)
Check out -f parameter of pkill.
Re:Benefits of using tmux – streamlining your development en... by amyjess on Tuesday November 08, 2016 @06:21PM (#12904871)
Ooh... nice! Thanks!