Tmux Commands Cheat Sheet for NetBSD 10.1

Complete Tmux Guide for NetBSD 10.1

text

📦 Installation (if not already installed)

pkgin install tmux
or
pkg_add tmux
text

🚀 Basic Startup Commands

tmux                    # Start new session
tmux new -s name # Start session with specific name
tmux a # Attach to last session
tmux a -t name # Attach to specific session
text

🎮 Shortcuts (Prefix Key)

All tmux commands start with Prefix (default: Ctrl+b)

Sessions

  • Prefix + d – Detach from current session
  • Prefix + s – List sessions
  • Prefix + $ – Rename current session

Windows

  • Prefix + c – Create new window
  • Prefix + n – Next window
  • Prefix + p – Previous window
  • Prefix + 0-9 – Go to specific window
  • Prefix + , – Rename current window
  • Prefix + & – Close current window

Panes

  • Prefix + % – Split vertically
  • Prefix + " – Split horizontally
  • Prefix + arrow – Navigate between panes
  • Prefix + x – Close current pane
  • Prefix + z – Zoom current pane (toggle)
  • Prefix + space – Toggle layouts

💻 Useful Terminal Commands

tmux ls                 # List active sessions
tmux kill-session -t name # Kill specific session
tmux kill-server # Kill all sessions
text

⚙️ Basic Configuration (~/.tmux.conf)

# Recommended settings for NetBSD
set -g default-terminal "screen-256color"
set -g history-limit 10000
set -g mouse on # Enable mouse (tmux 2.1+)

Custom shortcuts
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
text

🐧 NetBSD 10.1 Specific Tips

1. Color Issues

If you have color problems:

export TERM=xterm-256color

2. Compatibility Check

tmux -V

3. Clipboard on NetBSD

  • Select text with mouse
  • Prefix + [ to enter copy mode
  • Space to start selection, Enter to copy
  • Prefix + ] to paste

4. Auto-start

Add to ~/.profile:

if [ -z "$TMUX" ]; then
tmux attach -t default || tmux new -s default
fi
text

🔧 Troubleshooting Common Issues

  • Keys not working: Use tmux -2 to force 256 colors
  • Mouse problems: Disable in .tmux.conf if not working
  • Stuck sessions: tmux kill-server and restart

Note: These commands work well on NetBSD 10.1. The tmux version in standard repositories is generally stable and complete.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *