Skip to content

Contributing

Nicholas Marriott edited this page Dec 15, 2023 · 125 revisions

Source code and development process

tmux is part of the OpenBSD base system and OpenBSD CVS is the primary source repository:

https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/tmux/

GitHub holds the portable tmux version. There are a few minor differences, mostly for portability.

Code changes to the main tmux code are committed to OpenBSD and then a script automatically applies any new commits to the GitHub repository every few hours.

It is fine to develop and submit code changes with a GitHub PR, but the final form will be a patch file which is applied to OpenBSD CVS.

Releases

tmux currently sees a new release approximately every six months - the same schedule as OpenBSD, around May and October. This means that the GitHub releases contain roughly the same code as OpenBSD releases (but not necessarily exactly the same).

The release process consists of a branch from which one or more release candidates are produced for testing, until the final release is published and the branch removed.

Code contributions

Here is a list of outstanding feature requests or notes for future development. They are sorted into three sections approximately by difficulty of implementation. If there is a GitHub issue then its number is shown in brackets.

It is worth getting in touch before starting work, particularly on larger items, to avoid any duplication of effort.

Documentation

  • The getting started guide on the wiki need to be updated for 3.2 and later:

    • popups

    • using marked panes with tree mode

  • The advanced use guide is unfinished and also needs these added for 3.2 and later:

    • %local

    • terminal-features

Small things

  • (#3488) Allow entering and scrolling in copy mode when read only.

  • (#3466) Accept ANSI colour and attribute sequences for styles where appropriate.

  • (#2854) Add a monitor-input option like monitor-activity but that only fires when the pane has not seen any user input, not all types of activity.

  • (#3114) Allow prompt to appear on a different status line when multiple are configured.

  • (#3159) Key to centre cursor in copy mode.

  • (#3061) Format modifier to specify server, session, window, pane option to allow user options with the same name.

  • (#3047) Expand targets as formats. Should this be done by default or require a prefix (maybe a leading + or just look for #{)?

  • (#3074) Option to set the text shown with display-panes in the top right of the pane.

  • It would be nice if a menu item could be prefixed by a + (like - for disabled) and this mean the menu should not be closed when it is selected, instead the item text (or all items) should be regenerated. This would mean toggle items could be implemented by having the item toggle an option which caused a change in its text.

  • (#2953) Keep menus open on resize.

  • (#2840) A way to toggle line selection like rectangle-toggle.

  • (#2766) A flag to select-window to create the window, or to new-window to select.

  • (#2601) A way to handle duplicate window targets (choose MRU?). Note sure if should be default or optional.

  • (#2346) Add a flag to kill-session to kill a session group, and perhaps rename-session to rename one.

  • (#2671) Add a window-size manual-or-smallest which uses manual size only if there are no smaller clients.

  • It is annoying that -t= is still needed for select-window on the status line when it is not needed for panes.

  • "After" hooks are missing for many commands that do not use CMD_AFTERHOOK.

  • A command in copy mode to toggle the selection.

  • It would be nice to have some more preset layouts.

  • In emacs cursor movement cancels incremental search, tmux should work the same way.

  • (#2205) In copy mode, should add incremental search with regex (new commands).

  • When queueing notifications for control mode, there is no need to queue session notifications for sessions other than the attached one. Similarly for some window notifications.

  • (#3139) An option to change cursor style and colour when in copy mode (or any mode?).

Medium things

  • (#3655) Ability to change popup styles after it is open.

  • (#3503) Move panes or windows by dragging with mouse.

  • Preserve tabs for later use by copy mode. Probably the best way to do this would be to store them as an extended cell with a tab flag and the tab width instead of the UTF-8 character index. On output this can the be translated into spaces or a cursor movement (or left as tab for copy mode/capture-pane). That way the padding cell handling is the same as for wide characters - it would just need to be checked for assumptions about the maximum width being two. If there is existing content under the tab then the tab should probably not be stored and just treated as cursor movement.

  • (#3342) Ability to synchronize the scrolling of two panes in copy mode.

  • (#3258) Server-wide list of last used panes (and windows?) and mode to choose.

  • (#3166) A way to number matches in copy mode to easily select them, and default keys to number useful stuff.

  • More use of commands as their own objects:

    • Pretty print commands from list-keys etc.

    • Store commands in options (so thay can be pretty printed as well). Options would be better if they were not tied to the table, so the options tree allows any option to be any type, and set-option did the validation. Also if array indexes could be strings.

  • (#3036) Could choose mode show multiple columns?

  • (#2484) Highlight incoming text.

  • Allow focus to be put back to pane while leaving popup open, and back to popup later. Problem: what if a pane is completely obscured by popup?

  • A key table timeout and a key binding fired when timeout happens with the previous key in a format or something, would allow binding C-b 1 0 to window 10 while keeping C-b 1 for window 1.

  • (#2537) Copy mode should try to let the terminal wrap naturally if possible when redrawing so that terminal line copy works better. This could only happen when the terminal is the same width as it was when copy mode was entered. Redrawing a region would be difficult - have to redraw lines before in case it wraps? Maybe writing the copy mode screen could use grid_reader?

  • (#2495) Per-session window options.

  • (#2499) & (#2512) Add a way for command-prompt, confirm-before and possibly choose-tree and similar to print choice to stdout. Options are 1) to add flags to do it (like display-message -p) or 2) permit display-message -p to work when used as the choice command.

  • Per line grid time tracking and use of it in copy mode and elsewhere?

  • (#2354) Copy mode styles for the word and line.

  • Extend the active-pane flag to windows so a client can have an independent current window. This can be similar to how it works for panes but is probably more complicated. The idea would be to get rid of session groups.

  • Customize mode:

    1. way to export option or tagged options to a file;
    2. e key like in buffer mode to edit option value or key command in an editor popup;
    3. way to add new user options;
    4. way to add new key bindings;
    5. 'd' on a header should restore entire key table to default.
  • unbind -d flag to restore key bindings to default, with -a to restore all.

  • In copy mode - should the bottom be the last used line? It can be annoying to have to move the cursor through a load of empty space. It might be better to draw a line at the bottom (already have code for this) and prevent the cursor moving below it.

  • Completion at the command prompt could be more clever: it could recognise commands and have some way to describe their arguments so for example only complete options for set-option and layouts for select-layout; it could complete -t with a space after it as well as without; it could complete special targets like {left}; it could complete panes as well as windows. Probably lots more things.

  • Support DECSLRM margins within tmux itself.

  • Should remember the last layout before select-layout was used and select-layout without an argument should include it, so C-Space could cycle through it with the preset layouts. Also a separate flag or layout name to restore it directly. Or how about a layout history and a way to move back? A menu?

  • Should last pane be a stack like windows?

  • wait-for could do more, for example being able to wait for a pane to exit or close (could use the existing notify code in some way). Also a flag for a timeout or to stop waiting on a signal.

  • (#1784) A way to disable line wrap but preserve any trimmed content (so it can be viewed if the pane is made bigger).

  • Moving, joining and otherwise reorganizing panes, windows and session should be easier in tree mode. This should use the marked pane rather than mixing it up with tagging. Maybe keys to break/join/move without leaving tree mode? Also dragging would be nice.

  • Marked positions in history. Could use the same prompt-detection escape sequences as iTerm2. Could be listed by capture-pane and also a menu to jump to marks in copy mode. (#1042) is related and also has some code to display a marker line.

  • Make the command prompt able to take up multiple lines.

  • (#918) A way to specify how panes are merged when one is killed. Could be an option to kill-pane.

  • Allow multiple targets either with multiple -t or by giving a pattern or both.

  • It would be nice to be able to remember the position in copy mode and go back to the same place when entering it again. How would this work if the pane scrolls? What about entering with the mouse?

  • It would be nice to have commands to build a paste buffer in copy mode by doing multiple copies. It would need to display the work in progress somewhere (bottom left?) and have a command to add a chunk of text and a command to remove the last chunk and a command to clear.

  • (#1868) Vertical-only zoom.

  • (#1774) Resizing panes should move to the parent cell and resize it if this would allow the pane to become closer to what is requested.

  • (#3753) Improve SIXEL placeholders.

Large things

  • More consistent command handling (at cost of breaking all configs);

    • Commands given to other commands are all parsed immediately at parse time, basically either they have to be {} or strings becomes treated like {}. So if-shell and friends never get string arguments, only commands arguments.

    • Parser tags string arguments as " or '.

    • Before a command is executed, a callback is fired to get a format tree, then each " argument has formats expanded (other stuff could be expanded at the same time like \n which would simplify the parser).

    • %% expansion would remain a second expansion step, it could also apply only to " arguments.

    • All -F flags and inline format expansion become no-ops or removed.

    • Options would need to support commands as native arguments for both user options and hooks. This could be done without breaking any backwards compatibility.

    • command-alias is replaced with something else where the name and commands are given separately so the commands can be parsed up front (more like a function). An equivalent to the shell's argument accessor stuff like $1 and "$@" would need to be expanded at execution time.

    • I think some way to do execution type parsing would need to remain, an equivalent of eval - maybe run -C stays like this.

  • Better layouts. For example it would be good if they were driven by hints rather than fixed positions and could be automatically reapplied after resize/split/kill. Pane options can be used.

  • (#1269) Store grids in blocks. Can be used to reflow on demand. Would be nice to revisit how history-limit works - would it be better as a global limit rather than per pane?

  • (#2449) Link panes into multiple windows.

  • (#44) & (#1613) Support for SIXEL.