Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    21comments
  2. Cloudflare Quick Tunnels(cloudflare.com ↗)
    187comments
  3. Saving another 100TB of RAM with math (and Rust)(cloudflare.com ↗)
    5comments
  4. Apple releases iPhone Duo simulator and Xcode 27.1 beta(developer.apple.com ↗)
    3comments
  5. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    30comments
  6. Cache-to-Cache: Direct Semantic Communication Between Large Language Models(arxiv.org ↗)
    discuss
  7. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    55comments
  8. OpenJev(openjev.com ↗)
    229comments
  9. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    117comments
  10. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    158comments
  11. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    4comments
  12. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    134comments
  13. Systemd is a suite of basic building blocks(systemd.io ↗)
    38comments
  14. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    150comments
  15. Our brain evolved from two primitive nervous systems that merged: Study(newscientist.com ↗)
    22comments
  16. Show HN: Ax-check.com – Can agents use your product?(ax-check.com ↗)
    16comments
  17. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    9comments
  18. Border agents can search cellphones without a warrant or reasonable suspicion(lawandcrime.com ↗)
    34comments
  19. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    83comments
  20. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    192comments
  21. Minimal Phone 2(minimalcompany.com ↗)
    78comments
  22. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  23. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    5comments
  24. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    5comments
  25. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    12comments
  26. How to Write with an LLM(sockpuppet.org ↗)
    209comments
  27. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    5comments
  28. Show HN: Scry, programmable internet search w/ congestion pricing(scry.io ↗)
    12comments
  29. Jemalloc 5.4.0(github.com/jemalloc ↗)
    79comments
  30. I don't like passkeys(hawksley.dev ↗)
    641comments

tmux 1.8 Released

247 pointsby 13y agotmux.sourceforge.net
159 comments
13y agoHN ↗

  * Resizing panes will now reflow the text inside them.

Finally! I did not expect this feature, I thought the author was opposed to it. It is the one thing I have missed from screen (and part of the reason why I originally started using screen, since xterm does not reflow on resize either).

13y agoHN ↗

My favorite "resize-pane learnt '-Z' for zooming a pane temporarily."

13y agoHN ↗

"ctrl-[prefix] z" toggles zooming in on a pane now, this is awesome!!!

13y agoHN ↗

Anybody know if it's possible to move between terminal windows (panes in tmux lingo) "clockwise" and "anti-clockwise"?

13y agoHN ↗

Ctrl+b and then arrow keys will get you switching in all directions.

13y agoHN ↗

AFAIK there are tmux 'windows' which are like tabs and 'panes' which are vertical and horizontal splits in 1 tmux window

but assuming you mean 'panes', it seems you can:

Ctrl-b o

to move around the current window's panes clockwise. Although I prefer inputing a given direction like the other replier suggested with arrow keys.

For me moving between windows and panes is something that I do a lot. So much so that I removed the need to use the 'tmux prefix' to do so. In my ~/.tmux.conf I have for window and pane switching:

# set pane switching with <alt>{U, E, N, I} for up, down, left, right and respectively without needing prefix

bind -n M-N select-pane -L

bind -n M-I select-pane -R

bind -n M-U select-pane -U

bind -n M-E select-pane -D

# set window switching without needing prefix

bind -n M-a select-window -t :1

bind -n M-r select-window -t :2

bind -n M-s select-window -t :3

bind -n M-t select-window -t :4

bind -n M-d select-window -t :5

bind -n M-h select-window -t :6

You can just replace the keybindings I chose like M-a (alt-a) to something that works for you. If you want to keep using a prefix (incase you are worried the keybindings will clash with other program/system bindings), remove the '-n' flag. Hope that helps.

If it doesn't here is a tutorial I found from a google search: http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multip...

and IMO a really good book on Tmux if you decide to dive in more: http://www.amazon.com/tmux-Productive-Mouse-Free-Development...

13y agoHN ↗

Thanks. Yes, I meant panes.

I also did the thing to get rid of the tmux prefix for pane switching. But since I don't use the function keys, I mapped keys F1 through F9 to various tmux functions. F1 = next pane, F2 = prev pane. One less key to press. :)

13y agoHN ↗

cool! Hehe, ya, one less key to press FTW! :D

13y agoHN ↗

I use byobu http://byobu.co/

It binds the function keys which makes life so much easier. F2 starts new window, F3 and F4 rotate back and forwards. It also has a pretty neat status line.

13y agoHN ↗

What is the simplest way to install tmux 1.8 on Ubuntu 12.04?? Running `sudo apt-get install tmux` puts tmux 1.6 on my system...

13y agoHN ↗

Until it is packaged, it is fairly easy to build yourself. You just need libevent and ncurses.

13y agoHN ↗

Well the easiest way is either to wait for it to appear in the repos or wait for someone to package it and put it into a PPA. However, it doesn't have that many dependencies, so building it yourself is another not too stressful option.

13y agoHN ↗

    pushd /tmp && \
    wget 'http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.8/tmux-1.8.tar.gz?r=http%3A%2F%2Ftmux.sourceforge.net%2F&ts=1364579710&use_mirror=garr' && \
    gunzip < tmux-1.8.tar.gz | tar -vx && \
    cd tmux-1.8 && \
    ./configure --prefix=~/installs/tmux-1.8 && \
    mkdir ~/installs && \
    make && \
    make install && \
    popd
13y agoHN ↗

A simple `tar -xvf` can replace the separate `gunzip` and `tar` processes.

13y agoHN ↗

Yes, formally. You don't have to specify -z in GNU tar today, you can just say -x and it'll add -z or -j for you -- it figures out on the fly if the archive's been compressed and how. Very convenient.

13y agoHN ↗

You can bypass writing the archive to disk, as well:

    pushd /tmp && \
    curl 'http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.8/tmux-1.8.tar.gz?r=http%3A%2F%2Ftmux.sourceforge.net%2F&ts=1364579710&use_mirror=garr'| tar xvf && \
    cd tmux-1.8 && \
    ./configure --prefix=~/installs/tmux-1.8 && \
    mkdir ~/installs && \
    make && \
    make install && \
    popd
13y agoHN ↗

Shouldn't you be using checkinstall instead of 'make install' to make removal of the package easier in the future?

13y agoHN ↗

Not if you do local installs. You can remove the package simply by:

    rm -rf ~/installs/tmux-1.8
13y agoHN ↗

thanks @pkrumins - the download/compile/install cycle took about 30 seconds - the compiled executable seems to work perfectly.

13y agoHN ↗

instead of make install, consider checkinstall or fpm so that you are properly integrated into ubuntu's native package manager (dpkg). Doing so will save you headaches when you want to uninstall tmux or upgrade later.

13y agoHN ↗

I continue to be amazed by the people who install "random binaries" via PPA.

I guess I assume that if you want cutting-edge packages you'll use a cutting-edge release/distribution. If you don't, and you want something more recent then it seems to make sense to make your own packages, or install locally via gnu-stow, or similar.

13y agoHN ↗

Debian/Ubuntu packaging is far too difficult and thus creates bad incentives for people to install software from untrusted sources.

13y agoHN ↗

Should i finally switch from screens to tmux?

13y agoHN ↗

You should have switched a long time ago, but now is as good a time as any :P

13y agoHN ↗

You're going to open a big can of worms with that one ;). Tmux has quite a few more features than Screen, with Screen having a few features that are useful in edge cases[1]. It's hard to argue with tmux having bindings for vi/Emacs, as well.

If you're on a mac and use iTerm2, using tmux is somewhat of a no-brainer, thanks to the integration between tmux and iTerm2[2].

1: http://sourceforge.net/p/tmux/tmux-code/ci/master/tree/FAQ 2: https://code.google.com/p/iterm2/wiki/TmuxIntegration

13y agoHN ↗

With reflowing text added to tmux, and giving that "Lots and lots of bug fixes, fixing memory-leaks, etc." the benefit of the doubt, then I would say that unless you have a specific use case of screen (and if you do, you know it) then you should be using tmux.

13y agoHN ↗

I've loved tmux since I switched a couple of years ago. Try it out for a few weeks. I think you'll like it better than screen.

13y agoHN ↗

I switched from screen to tmux to screen back again.

tmux seemed slower while switching windows, plus I like the simplicity of screen.

13y agoHN ↗

I was a heavy screen user for years, and 'simple' is not what I would use to describe screen.

13y agoHN ↗

Using tmux 1.8 and switching between windows is super fast.

13y agoHN ↗

After mastering screen, I switched to tmux. It's a lot easier to configure. It's also a lot nicer to split panes etc...

Definitely recommend the switch. You might be dreading it, but two days into tmux you won't regret it. It took many weeks trying to convince myself screen is better until I actually tried tmux out.

13y agoHN ↗

Yes, you definitely should, just make sure to plop this into your .tmux.conf

    unbind C-b
    set -g prefix C-a
13y agoHN ↗

No, don't. C-b is a much better shortcut than C-a.

13y agoHN ↗

I agree, am i the only one using C-a in bash?

13y agoHN ↗

actually i'm using M+n (M=alt, n=number) to switch windows and i use M+[hjkl] to switch to left right top down window

13y agoHN ↗

I recommend the backtick: `

The only two pains that come with it are a) having to type `` to get a single `, and b) pasting anything containing a backtick behaves as if you'd typed it out.

13y agoHN ↗

I unbind M-Space from my window manager and use that for my prefix as well as for jumping to last window.

13y agoHN ↗

Tmux + Vim = Pure Awesome.

I use vim-slime[1] to send strings to other panes in tmux. I never type anything directly into a REPL. I just send my code from Vim to it. It's amazing with lisp or python. (A little less amazing with php, as the php repl IS AWEFUL)

[1] https://github.com/jpalardy/vim-slime

13y agoHN ↗

I totally agree. Plus, I use tmux + top, tmux + watch at work to get a quick idea on how my running experiments are going. It's really effective.

13y agoHN ↗

I love web pages like this. The top of it reads:

"tmux is a terminal multiplexer"

"What is a terminal multiplexer? It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. And do a lot more. See the manual."

That's awesome. So many times someone posts on HN "CaffBook.ly.errr 0.98 now released" and I have no idea what it is or why I would want it.

13y agoHN ↗

I appreciated it too. I've heard tmux mentioned plenty of times but never with a mention of what it is/does. That one line did it.

13y agoHN ↗

After years of using screen i switched to tmux.. i'm sure i'm not even using a 5th of the functionality but i love it.

13y agoHN ↗

What are the primary advantages that tmux has over GNU screen that you found ?

13y agoHN ↗

I'm also wondering about this. I've been using screen for almost 20 years, and wonder if there's a compelling reason to switch.

13y agoHN ↗

For me, tmux has saner options and more mnemonic default keyboard shortcuts, that do not interfere with default bash shortcuts (Ctrl-A is goto-home-of-line in bash/emacs, but it is hijacked by screen by default as its escape sequence; tmux uses Ctrl-B for the same by default, which in the emacs bindings means go-back-a-character, and I do not use much, and is less likely to hit by accident).

13y agoHN ↗

I want to like tmux, I really do, but my main gripes are scrolling in panes with the scroll wheel and selecting / copy/pasting text. iTerm (osx) or Terminator (linux) handle that much better, although I admit they can't really be compared technology-wise.

Alternatively, I never figured out how to select / copy text just as fast in tmux / vim / etc as with the mouse.

13y agoHN ↗

Add these to your ~/.tmux.conf

    setw -g mode-mouse on
    setw -g mouse-select-window on
    setw -g mouse-select-pane on
    setw -g mouse-resize-pane on

Then you can scroll in panes, but also select like normal by holding alt/option.

13y agoHN ↗

I also hated tmux mouse wheel scrolling.

But tmux 1.8 mouse wheel scrolling seems much improved over tmux 1.6 - to the point that it looks quite usable.

13y agoHN ↗

Use iTerm2. One of the new features of tmux is

* Control mode, which is a way for a client to send tmux commands. > Currently more useful to users of iterm2.

With this, if you connect to tmux via iTerm2, you can get it to pop up a window with tabs for each shell in the tmux session. History via the mouse wheel is native, changing tabs is native, new tab is native. Essentially you don't need to know any of the tmux commands at all unless you connect from a terminal program that doesn't know the protocol.

13y agoHN ↗

Is there any compelling reason to use tmux if you're already using a tiling window manager?

13y agoHN ↗

i've switched from tmux to screen to byobu ( which is a wrapper for screen ) because of its simplicity. screen also has very little problems, with tmux i always had time costly issues.

13y agoHN ↗

If you like tmux, also check out teamocil (https://github.com/remiprev/teamocil) to really enhance your use. It enables you to define tmux sessions via YAML, which is great for programmatically setting up a complex dev session. Mine, for example, fires up six panes in my preferred layout, and starts up a particular part of our project in each pane.

13y agoHN ↗

I used to use tmuxinator, but it's pretty much abandoned. There are pull requests that are over a year old. On the other hand, I submitted a pull request to teamocil and it was merged the same day.

13y agoHN ↗

I'll actually help maintain tmuxinator now. :) The project is really awesome but the author doesn't have enough time for it, so he added me to the project a few days ago. I'll go through the pull requests soon.

13y agoHN ↗

That's good to hear. I always hate to see good projects die because their creators are super busy. Good luck with taking things over!

13y agoHN ↗

Upvote for the best named project I've ever seen.

13y agoHN ↗

There's no 'i' in Timocyl, at least not where you think!

13y agoHN ↗

It's a reference to a TV show called Arrested Development.

13y agoHN ↗

Hacker News, man. Everybody's on here.

13y agoHN ↗

I only glanced it over, but I'm having a hard time seeing the advantage of this over shell scripts calling tmux commands.

13y agoHN ↗

You could achieve the same thing with shell scripts, but one of teamocil’s advantages is that it gives you the simplicity of YAML to build complex layouts.

13y agoHN ↗

It's definitely a well-done, and I'll be pointing new users of tmux at it. I would have been all over it if I would have seen it the first time I dove into tmux's man page way back when.

If I get a chance, I'll give a go at converting the scripts for some of the layouts I use all the time, and see if it sticks.

13y agoHN ↗

"simplicity of YAML"

Spoken like someone who's never actually looked into how complex YAML can be.

13y agoHN ↗

I don't see how someone could possibly write a tool like this without being aware of YAMLs potential complexity.

Well, I suppose it's possible, but it seems extremely unlikely.

13y agoHN ↗

These days it's very easy to use a simple api without knowing about the dragons lurking beneath the surface. Flip side of our "reusable components" holy grail.

13y agoHN ↗

If you don't like the YAML format of teamocil or tmuxinator and just want to write shell scripts to do the same thing, check out tmuxstart: https://github.com/treyhunner/tmuxstart

I made it shortly after switching to tmux last year. I hope this kind of functionality will eventually be built-in to tmux.

13y agoHN ↗

Anyone know if it is possible to do single combination keybindings? Currently all of the keybindings are things like 'Ctrl+W L', whereas I'd like to do things like 'Command+L'?

13y agoHN ↗

If you use bind-key -n C-f some-tmux-command it'll bind directly to Contrl-f. The -n means no prefix. I don't know how you'd make tmux recognize the Mac's command key though.

13y agoHN ↗

I realise you can rebind them, but both screen and tmux do themselves a disservice by choosing binding keys which overlap with prominent keys in emacs and for users who use emacs mode in their shell.

First impressions count.

If you want to configure tmux to use just a backtick as the escape, create ~/.tmux.conf

    unbind C-b
    set -g prefix `
    bind-key ` send-prefix

When you need to type a backtick just press it twice.

For screen, I used to do this:

    escape ``

.. in ~/.screenrc, but I've just tried it and it seems that there's now no easy way to type a backtick when you need one.

Query: in screen I can switch between two buffers by doing ctrl+a, ctrl+a. This doesn't work in tmux. How do I configure this to work in tmux?

13y agoHN ↗

Query: in screen I can switch between two buffers by doing ctrl+a, ctrl+a. This doesn't work in tmux. How do I configure this to work in tmux?

"Ctrl-b n" for next-window?

13y agoHN ↗

That's not quite what I'm after. I guess it's hard for non-screen people to know what I'm talking about from my vague description above :)

Here's a scenario to show what I mean: you're in buffer 5. You switch to buffer 2. Now if you do ctrl+a, ctrl+a, you leap back to buffer 5. And if you do it again, you go back to buffer 2. This is great when you're editing code in one session and running it in the other.

13y agoHN ↗

I use that screen behaviour for panes:

bind C-a last-pane

but last-window exists too.

13y agoHN ↗

awesome. I hadn't thought of that but it's much better. thank you.

I've now switched last-window to bind C-s last-window, because it's fast to tap out.

13y agoHN ↗

Is there a way to set it up to do this if you hit (escape-key) (current buffer index)? That's the way weechat works, and I keep expecting it to work in tmux as well :/

13y agoHN ↗

I think the idea is to be able to pound on whatever the defined escape key is to be able to toggle buffers, not that's he unable to find a command to switch to the next window.

13y agoHN ↗

    bind C-a last-window

Switch the C-a for whatever your bind-key is.

13y agoHN ↗

thank you sir! I am now entirely migrated to tmux. :)

13y agoHN ↗

Per your query: ctrl+a ctrl+a is how I switch between two windows (tmux calls them windows, they're basically tabs). If you want to switch between two panes (divisions inside a window, the equivalent of splitting the screen in a regular editor or visible buffers in vim/emacs), use ctrl-a o. I also have these bindings in my tmux conf for moving between panes painlessly:

    # use hjkl for moving
    bind h select-pane -L
    bind j select-pane -D
    bind k select-pane -U
    bind l select-pane -R
13y agoHN ↗

Nice one. I've now also added resize variations of these.

    bind-key C-j resize-pane -D 8
    bind-key C-k resize-pane -U 8
    bind-key C-h resize-pane -L 8
    bind-key C-l resize-pane -R 8
13y agoHN ↗

I bind C-z as the escape character (in screen). It seems to serve me well :)

13y agoHN ↗

Emacs users should be using Emacs as their terminal multiplexer...

13y agoHN ↗

Just open several terminal buffers in Emacs.

13y agoHN ↗

This isn't very useful if what you want to run in your terminal buffer needs to constantly update its screen while you're working in a different buffer (e.g. irc, tailing log files, etc)

13y agoHN ↗

Umm.. why is it not useful? Emacs will allow multiple buffers to update at once, and you can work in a third while watching them... That's kind of the idea.

13y agoHN ↗

M+x ansi-term should do it. I'm not sure how well that scales to many terminals though. M+x term also works. There is also eshell.

13y agoHN ↗

ansi-term and term are massively buggy.

I've never been able to get it to deal well with vast amounts of output well. Constant overwriting issues etc. Definitely prefer to use tmux + emacs considering the huge amount of stuff i end up throwing at my term.

13y agoHN ↗

; Open a terminal

M-x ansi-term

; Rename the buffer (escaping shell mode first)

C-c C-j M-x rename-buffer

; Shell responds to keyboard again

C-c C-k

; Split window in half horizontally

C-x 2

-----

I stole this (possibly from Steve Yegge or another source) long ago to somewhat automate the process of renaming terminal buffers:

  (global-set-key (kbd "<f2>") 'visit-ansi-term)

  ;; Terminal awesomeness
  (require 'term)
  (defun visit-ansi-term ()
    "If the current buffer is:
       1) a running ansi-term named *ansi-term*, rename it.
       2) a stopped ansi-term, kill it and create a new one.
       3) a non ansi-term, go to an already running ansi-term
          or start a new one while killing a defunt one"
    (interactive)
    (let ((is-term (string= "term-mode" major-mode))
          (is-running (term-check-proc (buffer-name)))
          (term-cmd "/usr/local/bin/zsh")
          (anon-term (get-buffer "*ansi-term*")))
      (if is-term
          (if is-running
              (if (string= "*ansi-term*" (buffer-name))
                  (call-interactively 'rename-buffer)
                (if anon-term
                    (switch-to-buffer "*ansi-term*")
                  (ansi-term term-cmd)))
            (kill-buffer (buffer-name))
            (ansi-term term-cmd))
        (if anon-term
            (if (term-check-proc "*ansi-term*")
                (switch-to-buffer "*ansi-term*")
              (kill-buffer "*ansi-term*")
              (ansi-term term-cmd))
          (ansi-term term-cmd)))))
13y agoHN ↗

Hey, I found that code hard to follow, with the if-then-elses nested 4 deep. A refactor, pretty much untested since I don't use ansi-term:

    (defun visit-ansi-term ()
      "If the current buffer is:
         1) a running ansi-term named *ansi-term*, rename it.
         2) a stopped ansi-term, kill it and create a new one.
         3) a non ansi-term, go to an already running ansi-term
            or start a new one while killing a defunct one."
      (interactive)
      (let ((is-term      (string= "term-mode" major-mode))
            (is-ansi-term (string= "*ansi-term*" (buffer-name)))
            (is-running   (term-check-proc (buffer-name)))
            (anon-term    (get-buffer "*ansi-term*")))
        (cond
         ((and is-term is-running is-ansi-term)
          (call-interactively 'rename-buffer))
         ((and anon-term (if is-term
                             (and is-running (not is-ansi-term))
                           (term-check-proc "*ansi-term*")))
          (switch-to-buffer "*ansi-term*"))
         (t
          (cond ((and is-term (not is-running))
                 (kill-buffer (buffer-name)))
                ((and anon-term (not (term-check-proc "*ansi-term*")))
                 (kill-buffer "*ansi-term*")))
          (ansi-term "/usr/local/bin/zsh")))))
13y agoHN ↗

shell mode + emacs --daemon + emacsclient = all the multiplexing a growing engineer might need.

13y agoHN ↗

One reason to run Emacs in tmux is if you work on remote machines over, e.g. ssh. Emacs in tmux (or screen) lets you detach, log out then log back in and re-attach to the remote session with Emacs still running. That's amazingly handy.

13y agoHN ↗

You still need a remote shell open if you want to run make, use SCM plugins, etc, so I've never found tramp that useful. If there's a clever solution for that I'd love to hear it.

13y agoHN ↗

eshell interfaces pretty well with tramp (well, not over FTP obviously, but ssh) so if you're editing a file over tramp and start eshell, it'll be in the directory of the file on the remote host. you can also use tramp-y paths in eshell:

cd /user@host:/home/user/

13y agoHN ↗

I realize I'm a bit late to reply, but thanks for the tip. The biggest problem I had was with p4 mode (we use perforce at work) and rope-mode - I didn't really feel like hacking those to get it to work with tramp. And I can keep everything open across network disconnects with screen or tmux...

13y agoHN ↗

Actually, make works in tramp by default if you use 'M-x compile' and friends.

13y agoHN ↗

Emacs-server does the same thing.

C-h f server-start

13y agoHN ↗

Well - it's my tool of choice for editing Makefiles. :) But that's all I use it for. My vim setup automatically hammers tabs to spaces, and make doesn't like that.

Shell users who use emacs mode (most ppl) may be annoyed by ctrl+a missing.

13y agoHN ↗

The following line in your vimrc will make vim not expand tabs for every file named "Makefile".

    au BufRead,BufNewFile Makefile set noexpandtab
13y agoHN ↗

Wow - this thread is full of good advice. I have not touched my dot files in about four years, and today they're all getting an upgrade. Thanks!

13y agoHN ↗

At least in my vim, Makefiles are automatically set to noexpandtab even-though I have it set to automatically expand tabs for everything else.

13y agoHN ↗

If ctrl-a is your escape key then just do this:

    bind-key C-a last-window
13y agoHN ↗

   bindkey 'a' last-window
   bindkey C-a last-window

if you use the command frequently enough, it might be worthwhile binding `^a a` and `^a^a`, similar to the tactic of binding F1 to <esc> in vim

13y agoHN ↗

I use the null character in GNU screen:

    escape ^@^@

On most keyboards, you can enter it with control-space, which is very easy to type and rarely used for other purposes (though emacs uses for `set-mark-command`).

Control-] can also be a good choice (at least for US-style keyboards that don't require shift for the square brackets).

13y agoHN ↗

i suggest new commer give byobu a try, a wrapper of tmux.

13y agoHN ↗

Incompatible Changes ====================

* layout redo/undo has been removed.

Normal Changes ==============

* Add halfpage up/down bindings to copy mode.

* Session choosing fixed to work with unattached sessions.

* New window options window-status-last-{attr,bg,fg} to denote the last window which was active.

* Scrolling in copy-mode now scrolls the region without moving the mouse cursor.

* run-shell learnt '-t' to specify the pane to use when displaying output.

* Support for middle-click pasting.

* choose-tree learns '-u' to start uncollapsed.

* select-window learnt '-T' to toggle to the last window if it's already current.

* New session option 'assume-paste-time' for pasting text versus key-binding actions.

* choose-* commands now work outside of an attached client.

* Aliases are now shown for list-commands command.

* Status learns about formats.

* Free-form options can be set with set-option if prepended with an '@' sign.

* capture-pane learnt '-p' to send to stdout, and '-e' for capturing escape sequences, and '-a' to capture the alternate screen, and '-P' to dump pending output.

* Many new formats added (client_session, client_last_session, etc.)

* Control mode, which is a way for a client to send tmux commands. Currently more useful to users of iterm2.

* resize-pane learnt '-x' and '-y' for absolute pane sizing.

* Config file loading now reports errors from all files which are loaded via the 'source-file' command.

* 'copy-pipe' mode command to copy selection and pipe the selection to a command.

* Panes can now emit focus notifications for certain applications which use those.

* run-shell and if-shell now accept formats.

* resize-pane learnt '-Z' for zooming a pane temporarily.

* new-session learnt '-A' to make it behave like attach-session.

* set-option learnt '-o' to prevent setting an option which is already set.

* capture-pane and show-options learns '-q' to silence errors.

* New command 'wait-for' which blocks a client until woken up again.

* Resizing panes will now reflow the text inside them.

* Lots and lots of bug fixes, fixing memory-leaks, etc.

* Various manpage improvements.

13y agoHN ↗

* Resizing panes will now reflow the text inside them.

This is all I needed to know to upgrade.

13y agoHN ↗

Two things I missed from screen last I tried tmux: an equivalent of 'screen -xRR' and an orthogonality between terminals and windows so that distinct terminals connected to one session can display different windows. Especially the latter of these is integral to my workflow.

13y agoHN ↗

tmux has been a great recent upgrade for me -- switched from a bunch of nested screens. really highly recommended.

13y agoHN ↗

... Except the splits are inside the terminal session, so if you connect from another machine, you'll have access to all your panes

13y agoHN ↗

With terminator, you can have a windowing editor (vim) inside a windowing session manager (tmux) inside a windowing terminal (terminator).

Inception!

13y agoHN ↗

... inside a window manager (compiz) inside a nested x session (Xnest) inside a virtual machine (VirtualBox) inside a chroot.

13y agoHN ↗

neat. this was the one feature i missed from xmonad!

13y agoHN ↗

Does anyone know where to find a good introduction to tmux?

I attempted to start using it a couple of weekends ago but wasn't able to find any good documentation with my google-fu.

13y agoHN ↗

And the book is $7.20 on Amazon for the Kindle, FYI. I just bought it (versus $14something @ pragprog)

13y agoHN ↗

Author here. I know it's better for you to get the book cheaper, but PragProg gives authors 50% royalty on the sale of the book. If you buy it from pragprog, I get more in my pocket than if you buy from Amazon.

Either way, thanks for reading. I hope it's enjoyable. Some minor updates are coming to the book too.

13y agoHN ↗

Glad you liked the book. I'm going to rolling out some minor changes in a couple days just to keep it updated with 1.8.

13y agoHN ↗

Does this release have better performance than previous releases? I enjoy using tmux, but for some applications (i.e. with large amounts of text spewing to the console) it just hasn't (historically) performed as well as GNU screen.

13y agoHN ↗

Don't know if I'm the only one in this boat, but I often feel pretty conflicted about upgrading to a newer version of a tool where I have had a lot of configuration and shortcuts defined for ages. If any of them break, you'll have to go back and dig through the arcane tmux config file, figure out what changed.

13y agoHN ↗

the new choose-tree commmand is superb, for anyone who regularly uses tmux and already understands how great it is, you should consider upgrading for this alone..

with several sessions running on most of my machines, i frequently found myself `detaching` and `reattaching` to a different session... as the `choose-session` command gives you a full list of all the windows, which tends to obfuscate exactly what's going on, particularly if you have a bunch of sessions and windows..

however, the `choose-tree` gives you a session tree, which you can expand and easily identify... meaning that instead of sending `^a d`, followed by tmux attach sessionname you can comfortably do a `^a s` and get where you want to be (presuming you've remapped ^b to ^a)

also, you should be using the tmux buffers, `^a =`!

13y agoHN ↗

For the lulz I use neercs. It's the same as screen and tmux, except you get thumbnails of your panes in some kind of taskbar; and most importantly, you can switch between panes with a cube ascii animation, compiz style.

http://caca.zoy.org/wiki/neercs

13y agoHN ↗

One thing that I really want is the ability to set different background colors for panes and windows. Sadly, it is a feature of a terminal app, not tmux. One can only imagine tmux would integrate tightly with various terminal applications to accomplish that.

13y agoHN ↗

If you are moving from screen to tmux, it's very easy to configure tmux to behave like screen. Also, for split panes, I like vim bindings('C-a l' for left pane, 'C-a r' for right pane, 'C-a <' for resize pane...). I have bindings for copying tmux buffer to and from clipboard(needs xclip).

https://gist.github.com/rahulkmr/5275679

13y agoHN ↗

id love zmodem support... but I'm probably the only one that uses it

13y agoHN ↗

Yes, that† and the possibility to directly connect to a serial port (like screen does). Would be a huge time-saver for the embedded folks.

†) or rather not builtin zmodem-support but generic "run this program with stdin/stdout connected directly to the device" like cu's ~+ escape.

13y agoHN ↗

pracically - how is it different form screen ?

13y agoHN ↗

'copy-pipe' mode command to copy selection and pipe the selection to a command.

This is exactly the functionality I was looking for back when it didn't exist. It wasn't immediately obvious how to use this, but here's how:

bind-key -t vi-copy 'y' copy-pipe "redis-cli -x set status"

set-option -g status-right '#(redis-cli --raw get status)'

And now I have a message I just copied to redis in my tmux status bar. I'm planning on doing this with clipboard text next.