phux docs

Getting started

This page walks through a first session: start phux, split and move between panes, open tabs and sessions, detach, and come back. It assumes phux is installed.

phux

Press C-a d (Ctrl+a, then d) to detach. Run phux again to come back to exactly where you were.

Start phux

phux

The first run starts a server in the background and attaches you to a new session named after the current directory. Your shell runs in a pane inside it. Later runs attach to the session you used last.

Closing the terminal doesn’t end anything. The server keeps your shells and the programs in them running until you end them. Concepts explains the server and what survives what.

The prefix

Every phux key starts with the prefix, C-a (Ctrl+a). Press it, let go, then press the key for what you want. C-a % means “press C-a, then %”.

Keys you press without the prefix go to the program in the pane. phux binds none of them out of the box.

Find any key

You don’t need to memorize anything on this page. Two things show you the keys as you go:

  • The which-key popup. Press C-a and wait a moment. A popup lists every key you can press next, grouped into Pane, Tab, Session, and phux. It never eats a key: press one and it runs as if the popup weren’t there. Esc cancels the prefix.
  • The command palette. Press C-a Space (or : or ?) to search every action by name. Each row shows its key, so the palette is also how you learn them.

Default key bindings lists every key on one page.

Split and move between panes

A pane is one terminal. Split the one you’re in:

KeysDoes
C-a % or C-a |split right
C-a ” or C-a -split below
C-a h j k lmove to the pane left, down, up, right
C-a H J K Lresize the pane left, down, up, right
C-a Rresize mode: h j k l or the arrows resize one cell at a time; Esc leaves
C-a onext pane
C-a =the pane you were in before
C-a zzoom the pane to fill the tab; again to unzoom
C-a xclose the pane

C-a x closes the pane right away, without asking, and ends the program in it. Capital letters mean Shift: H is Shift+h.

Tabs

A tab holds a set of panes. The status bar along the top shows your tabs.

KeysDoes
C-a cnew tab
C-a n or C-a Tab, C-a pnext, previous tab
C-a 0–9go to tab 0–9
C-a wpick a tab from every session
C-a ,rename the tab
C-a Xclose the tab and everything in it (asks first)

Sessions

A session is a named workspace, usually one per project. Each holds its own tabs.

KeysDoes
C-a Cnew session
C-a spick a session
C-a N, C-a Pnext, previous session
C-a )the session you were in before
C-a $rename the session

From a shell:

phux ls               # list sessions
phux new work         # create a session called "work" and attach
phux attach work      # attach to it later
phux kill work        # end it and everything in it (asks first)

Detach and come back

Press C-a d to detach. The UI closes; your shells, and whatever runs in them, keep going.

phux

Run phux again, from this terminal or any other, to pick up where you left off. Losing an SSH connection is the same as detaching.

Scroll and copy

Scroll a pane’s history with the mouse wheel. For keyboard selection, press C-a [ to enter copy mode:

KeysDoes
arrow keysmove the cursor; at the edge, scroll
Shift+arrowsextend the selection
PageUp, PageDownscroll a page
Tabswitch between character, line, and block selection
/, ?search down, up; n and N repeat
Entercopy the selection and leave
w, v, Acopy the word, the line, or everything, and leave
]copy the last command’s output and leave
Escleave without copying

Copies go to your system clipboard through your terminal (OSC 52), so they work over SSH too if your terminal allows it.

Mouse

The mouse is on by default:

  • Click a pane to focus it.
  • Drag a divider to resize panes.
  • Drag across text to copy it.
  • Right-click for a menu of actions for that pane, tab, or session.
  • Click a tab to switch to it; drag it to reorder.

Programs that use the mouse themselves, such as htop or an editor, still get clicks over their own panes. To leave the mouse to your terminal’s own selection instead, set mouse = false under [defaults] in your config file.

The sidebar

The sidebar lists your coding agents (with which ones need you) and your sessions. Press C-a b to show or hide it. On a narrow terminal it stays hidden so your panes get the room.

When an agent is waiting on you, C-a q jumps to it and C-a Q takes you back. C-a A opens every agent and its state. Coding agents covers the rest.

Coming from tmux

Already have tmux configured the way you like? Run phux config import-tmux to preview a native config layer and a report of what carries over. See Bring your tmux keys to phux before applying it.

Most keys match tmux, with C-a where tmux uses C-b. What’s different:

In tmuxIn phux
prefix C-bprefix C-a; set it back if you like
“window”“tab” in the UI; actions in the config file still say window (new-window)
arrow keys move between panesh j k l
; last pane=; ; is the previous pane
x asks before closing a panex closes it right away
& closes a windowX closes a tab (asks first)
( ) previous, next sessionP N; ) is the last session
q shows pane numbersq jumps to the next pane that needs you
send-prefix sends the prefix throughpress the prefix twice: C-a C-a sends C-a to the program. Any key with no binding after the prefix goes to the program
copy mode with vi or emacs keysarrow keys; Enter copies to the system clipboard
tmux source-file ~/.tmux.confphux config reload
tmux capture-pane -pphux snapshot
tmux kill-serverphux kill --server

For when tmux is still the better fit, see phux vs tmux, Herdr, and cmux.

Keep C-b

Put this in ~/.config/phux/config.toml:

[keybindings]
prefix = "C-b"

Then reload with phux config reload. Key bindings covers rebinding and unbinding any key.

Next