summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window-copy.c
AgeCommit message (Collapse)Author
2017-06-09Add a hook when the clipboard is set.Nicholas Marriott
2017-06-03Make set-clipboard a three-state option so tmux itself can ignore theNicholas Marriott
sequencess.
2017-05-30Rewrite of choose mode, both to simplify and tidy the code and to addNicholas Marriott
some modern features. Now the common code is in mode-tree.c, which provides an API used by the three modes now separated into window-{buffer,client,tree}.c. Buffer mode shows buffers, client mode clients and tree mode a tree of sessions, windows and panes. Each mode has a common set of key bindings plus a few that are specific to the mode. Other changes are: - each mode has a preview pane: for buffers this is the buffer content (very useful), for others it is a preview of the pane; - items may be sorted in different ways ('O' key); - multiple items may be tagged and an operation applied to all of them (for example, to delete multiple buffers at once); - in tree mode a command may be run on the selected item (session, window, pane) or on tagged items (key ':'); - displayed items may be filtered in tree mode by using a format (this is used to implement find-window) (key 'f'); - the custom format (-F) for the display is no longer available; - shortcut keys change from 0-9, a-z, A-Z which was always a bit weird with keys used for other uses to 0-9, M-a to M-z. Now that the code is simpler, other improvements will come later. Primary key bindings for each mode are documented under the commands in the man page (choose-buffer, choose-client, choose-tree). Parts written by Thomas Adam.
2017-05-29Do not factor in screen_hsize() for the visible copy mode screen whenNicholas Marriott
adjusting the selection, it should never have any useful history (and when it does, after resize, we shouldn't use it). From Michal Mazurek.
2017-05-12Scrolling needs to use background colour.Nicholas Marriott
2017-05-12Store copy mode search string in pane so search-again command works evenNicholas Marriott
if you exit and reenter copy mode (it doesn't remember the position, just the search string), suggested by espie@.
2017-05-07Add a format for the name of the pane's mode, lets it be used as aNicholas Marriott
conditional for key bindings.
2017-05-03Add a format for the last search string in copy mode and fix the promptNicholas Marriott
so it can work when in -I, suggested by Suraj N Kurapati.
2017-04-20If a #() command doesn't exit, use its most recent line of output (itNicholas Marriott
must be a full line). Don't let it redraw the status line more than once a second. Requested by someone about 10 years ago...
2017-03-24Show count of search results in copy mode.Nicholas Marriott
2017-03-21Fix movement after select-line, from Omar Sandoval.Nicholas Marriott
2017-03-08Skip over padding cells when moving the cursor left or right.Nicholas Marriott
2017-03-08Add a helper function for the most common format_create/defaults/expandNicholas Marriott
pattern.
2017-02-08window_copy_pagedown shouldn't reset the mode anymore, instead let theNicholas Marriott
caller do it so it can free the marks. Problem reported by attila at stalphonsos dot com.
2017-02-03Add a window or pane id "tag" to each format tree and use it to separateNicholas Marriott
jobs, this means that if the same job is used for different windows or panes (for example in pane-border-format), it will be run separately for each pane.
2017-01-07Add support for the OSC 4 and OSC 104 palette setting escape sequences,Nicholas Marriott
from S Gilles.
2017-01-06Incremental search in copy mode (on for emacs keys by default) - muchNicholas Marriott
the same as normal searching but updates the cursor position and marked search terms as you type. C-r and C-s in the prompt repeat the search, once finished searching (with Enter), N and n work as before.
2017-01-05Highlight all occurrences of search string after searching in copy mode.Nicholas Marriott
2016-11-24Make the selection able to exist independent of the cursor position, soNicholas Marriott
that it is not affected by scrolling. If MouseDragEnd1Pane is bound to the new "stop-selection" command: bind -Tcopy-mode MouseDragEnd1Pane stop-selection A selection made with the mouse will stay as it is after button 1 is released. (It also works bound to a key.) From Artem Fokin.
2016-11-15Add copy-pipe-and-cancel, from Artem Fokin.Nicholas Marriott
2016-10-13Add support for BCE (background colour erase). This makes various escapeNicholas Marriott
sequences (notable EL and ED but also IL, DL, ICH, DCH) create blank cells using the current background colour rather than the default colour. On modern systems BCE doesn't really have many benefits, but most other terminals now support it, some (lazy) applications rely on it, and it is not hard to include now that we have pane background colours anyway. Mostly written by Sean Haugh.
2016-10-12Unused variable and missing time.h.Nicholas Marriott
2016-10-11Add static in window-*.c and move some internal functions out of tmux.h.Nicholas Marriott
2016-10-11Support double and triple clicks (they are cumulative, so double isNicholas Marriott
fired then triple), and use for select-word and select-line in copy mode. Inspired by a different solution from Omar Sandoval.
2016-10-11Fundamental change to how copy mode key bindings work:Nicholas Marriott
The vi-copy and emacs-copy mode key tables are gone, and instead copy mode commands are bound in one of two normal key tables ("copy-mode" or "copy-mode-vi"). Keys are bound to "send-keys -X copy-mode-command". So: bind -temacs-copy C-Up scroll-up bind -temacs-copy -R5 WheelUpPane scroll-up Becomes: bind -Tcopy-mode C-Up send -X scroll-up bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up This allows the full command parser and command set to be used - for example, we can use the normal command prompt for searching, jumping, and so on instead of a custom one: bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward '%%'" command-prompt also gets a -1 option to only require on key press, which is needed for jumping. The plan is to get rid of mode keys entirely, so more to come eventually.
2016-10-09Use xsnprintf not snprintf for the prompt in window_copy_write_lineNicholas Marriott
because we don't care if it is truncated to the screen width, we don't want it to be fatal.
2016-10-03Remove some dead code in cmd-move-window.c and make a load of localNicholas Marriott
functions static.
2016-09-12Allow repeat count to be specified in mode key tables with bind-key -R,Nicholas Marriott
and set the default repeat count to 5 for WheelUp and WheelDown in copy-mode.
2016-05-23Remove unused variable, from Ben Boeckel.Nicholas Marriott
2016-05-03Some tidying of copy mode search functions, based on a diff from LukaszNicholas Marriott
Piatkowski (initial changes to help some more to come).
2016-05-01Use the same code for half page scrolling as full, from Michal Mazurek.Nicholas Marriott
2016-04-27Add next/previous paragraph, from J Raynor.Nicholas Marriott
2016-03-18Make scrolling behaviour more sensible and maintain cursor position, asNicholas Marriott
if the same had been done line-by-line. From Michal Mazurek.
2016-03-01When a mouse drag is finished, fire a MouseUp key press, instead ofNicholas Marriott
doing the drag end in code. From Stephen Coakley.
2016-02-05Do not wrap cursor at start or end of history, from Michal Mazurek.Nicholas Marriott
2016-01-19I no longer use my SourceForge address so replace it.Nicholas Marriott
2015-12-11Add cmdq as an argument to format_create and add a format for theNicholas Marriott
command name (will also be used for more later).
2015-12-08Remove format_create_flags and just pass flags to format_create.Nicholas Marriott
2015-11-18Use __unused rather than rolling our own.Nicholas Marriott
2015-11-13Long overdue change to the way we store cells in the grid: now, insteadNicholas Marriott
of storing a full grid_cell with UTF-8 data and everything, store a new type grid_cell_entry. This can either be the cell itself (for ASCII cells), or an offset into an extended array (per line) for UTF-8 data. This avoid a large (8 byte) overhead on non-UTF-8 cells (by far the majority for most users) without the complexity of the shadow array we had before. Grid memory without any UTF-8 is about half. The disadvantage that cells can no longer be modified in place and need to be copied out of the grid and back but it turned out to be lot less complicated than I expected.
2015-11-12Nuke the utf8 and status-utf8 options and make tmux only a UTF-8Nicholas Marriott
terminal. We still support non-UTF-8 terminals outside tmux, but inside it is always UTF-8 (as when the utf8 and status-utf8 options were on).
2015-11-12Support UTF-8 key bindings by expanding the key type from int toNicholas Marriott
uint64_t and converting UTF-8 to Unicode on input and the reverse on output. (This allows key bindings, there are still omissions - the largest being that the various prompts do not accept UTF-8.)
2015-10-31Because pledge(2) does not allow us to pass directory file descriptorsNicholas Marriott
around, we can't use file descriptors for the working directory because we will be unable to pass it to a privileged process to tell it where to read or write files or spawn children. So move tmux back to using strings for the current working directory. We try to check it exists with access() when it is set but ultimately fall back to ~ if it fails at time of use (or / if that fails too).
2015-10-27Move struct options into options.c.Nicholas Marriott
2015-10-23Format for scroll position, from Jorge Morante.Nicholas Marriott
2015-09-14Style nit, int for flags not u_int.Nicholas Marriott
2015-09-13Add copy-mode -e to exit copy mode when scrolling off the bottom, usefulNicholas Marriott
for quick view of history, from Cam Hutchison.
2015-08-29Move struct paste_buffer out of tmux.h.Nicholas Marriott
2015-08-28Give clock mode its own timer.Nicholas Marriott
2015-04-24Set working directory for run-shell and if-shell.Nicholas Marriott