Hacker News new | past | comments | ask | show | jobs | submit login

I used screen for like 10-15 years. Two years ago, I switched to tmux because of some rough edges with screen. I can't remember what they were now, I think something to do with selecting the correct terminal type (TERM=screen? TERM=xterm-256color? TERM=screen.xterm-256color?). Something went wrong, and I couldn't fix it.

Normally, I try to keep to the application's defaults for portability, but the screen key-bindings are in my muscle memory. I was able to migrate to tmux almost seamlessly with just a few key-bindings in .tmux.conf, which is reproduced below in its entirety:

(Edit: formatting)

----

# Remap prefix from 'C-b' to 'C-a' (compat screen(1))

unbind C-b

set-option -g prefix C-a

# Send C-a: 'C-a a'

bind a send-prefix

# Flip to previous window: `C-a C-a' (compat screen(1))

bind C-a last-window

# Make C-n and C-p act like 'n' and 'p' (compat screen(1))

bind C-n next-window

bind C-p previous-window

# Make C-a C-[ act like C-a [ (compat screen(1)

bind C-[ copy-mode

# Change background color of status line from green to yellow for readability

set-option -g status-style bg=yellow

# Increase scrollback to 5000 lines from 2000 default

set-option -g history-limit 5000

----




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: