Commit Graph

  • 924bf8477f Typo in grid_duplicate_lines (sy for dy) causing it to write into the wrong place when copying UTF-8 data. Found by Dan Colish. Nicholas Marriott 2009-07-16 07:34:37 +00:00
  • 6fe25a08d7 Improved NetBSD current-process detection from Roy Marples. Nicholas Marriott 2009-07-15 17:53:15 +00:00
  • 222b8e6743 Make status_message_set a variadic printf-like function. No functional change - helpful for a couple of things coming soon. Nicholas Marriott 2009-07-15 17:50:11 +00:00
  • d6908dd9c2 Return -1 not NULL on error, pointed out by Roy Marples. Nicholas Marriott 2009-07-15 17:46:09 +00:00
  • ac2ab6501d Add a -k flag to unlink-window which makes it behave the same as the old kill-window - if a window is linked into only one session it unlinked and destroyed. Nicholas Marriott 2009-07-15 17:45:29 +00:00
  • 8bfbc8c61d The man page says that kill-window removes the window entirely, unlinking it from any sessions. In fact the implementation only affected the current session, making it the same as unlink-window but destroying the window if it was linked into only one session (unlinkw gives an error). Change the behaviour to match what it documented and was originally intended. Nicholas Marriott 2009-07-15 17:45:09 +00:00
  • ff90170738 Having to update NSETOPTION/NSETWINDOWOPTION when adding new options is a bit annoying and it is only use for iterating, so use a sentinel to mark the end of each array instead. Different fix for a problem pointed out by Kalle Olavi Niemitalo. Nicholas Marriott 2009-07-15 17:44:47 +00:00
  • 6ebb1df8fe Add main-pane-height to the options list (was missed before). Nicholas Marriott 2009-07-15 17:44:25 +00:00
  • ff500b46c9 For some reason when clearing status/message it was redrawing the entire client not just the status line. Changing this also revealed the check for the status line was incorrect when drawing the pane. Nicholas Marriott 2009-07-15 17:44:06 +00:00
  • 72d56bd614 Instead of faking up a status line in status_redraw, use the same code to redraw it as to draw the entire screen, just skip all lines but the last. Nicholas Marriott 2009-07-15 17:43:45 +00:00
  • ad1945c278 Don't accept input to a window if it not visible. Nicholas Marriott 2009-07-15 17:43:21 +00:00
  • 82b45b460e The scroll region cannot be one line only, ignore attempts to make it so. Nicholas Marriott 2009-07-15 17:43:02 +00:00
  • 1e574bb70c Get rid of the PANE_HIDDEN flag in favour of a function, and moving the decision for whether or not a pane should be drawn out of the layout code and into the redraw code. Nicholas Marriott 2009-07-15 17:42:44 +00:00
  • 92da443a9e Make status_message_set a variadic printf-like function. No functional change - helpful for a couple of things coming soon. Nicholas Marriott 2009-07-15 17:39:00 +00:00
  • 780fd8f7a6 Return -1 not NULL on error, pointed out by Roy Marples. Nicholas Marriott 2009-07-15 15:09:17 +00:00
  • aa3403a343 Add a -k flag to unlink-window which makes it behave the same as the old kill-window - if a window is linked into only one session it unlinked and destroyed. Nicholas Marriott 2009-07-15 08:05:56 +00:00
  • 9601b72e4c The man page says that kill-window removes the window entirely, unlinking it from any sessions. In fact the implementation only affected the current session, making it the same as unlink-window but destroying the window if it was linked into only one session (unlinkw gives an error). Change the behaviour to match what it documented and was originally intended. Nicholas Marriott 2009-07-15 08:00:49 +00:00
  • ca617d679f Having to update NSETOPTION/NSETWINDOWOPTION when adding new options is a bit annoying and it is only use for iterating, so use a sentinel to mark the end of each array instead. Different fix for a problem pointed out by Kalle Olavi Niemitalo. Nicholas Marriott 2009-07-15 07:50:34 +00:00
  • 615d85fb23 Add main-pane-height to the options list (was missed before). Nicholas Marriott 2009-07-14 20:20:04 +00:00
  • f08c9b2217 For some reason when clearing status/message it was redrawing the entire client not just the status line. Changing this also revealed the check for the status line was incorrect when drawing the pane. Nicholas Marriott 2009-07-14 19:11:58 +00:00
  • ae2ea52575 Instead of faking up a status line in status_redraw, use the same code to redraw it as to draw the entire screen, just skip all lines but the last. Nicholas Marriott 2009-07-14 19:03:16 +00:00
  • 537c32b6b6 Escape ~, pointed out by tcunha. Nicholas Marriott 2009-07-14 17:44:24 +00:00
  • e76caa0017 Don't accept input to a window if it not visible. Nicholas Marriott 2009-07-14 16:52:50 +00:00
  • 975f516f51 The scroll region cannot be one line only, ignore attempts to make it so. Nicholas Marriott 2009-07-14 14:47:32 +00:00
  • fe20c0d89e Get rid of the PANE_HIDDEN flag in favour of a function, and moving the decision for whether or not a pane should be drawn out of the layout code and into the redraw code. Nicholas Marriott 2009-07-14 07:23:36 +00:00
  • f44ae0535e Need time.h not sys/time.h for time(2). Nicholas Marriott 2009-07-14 07:01:03 +00:00
  • 4a9b01eb0d Need time.h not sys/time.h for time(2). Nicholas Marriott 2009-07-14 06:59:06 +00:00
  • 6910458a92 Add backspace key to named keys. Nicholas Marriott 2009-07-14 06:56:30 +00:00
  • 910d6282c4 Whoops, chose the wrong one in a conflict. Revert. Nicholas Marriott 2009-07-14 06:54:38 +00:00
  • 20e322bf9b arg.c is no longer required. Nicholas Marriott 2009-07-14 06:47:46 +00:00
  • edd3142d1f Don't need ncurses, use curses. Nicholas Marriott 2009-07-14 06:47:12 +00:00
  • 097b96ea44 Having fixed flags for single-character getopt options is a bit hard to maintain and is only going to get worse as more are used. So instead, add a new uint64_t member to cmd_entry which is a bitmask of upper and lowercase options accepted by the command. Nicholas Marriott 2009-07-14 06:43:33 +00:00
  • 5ccd0025a0 copy-mode and scroll-mode have a -u flag missing from usage, add it. Nicholas Marriott 2009-07-14 06:42:22 +00:00
  • d358a352c0 Tidy up and improve target (-t) argument parsing: Nicholas Marriott 2009-07-14 06:42:06 +00:00
  • e63567d51c Support "alternate screen" mode (terminfo smcup/rmcup) typically used by full screen interactive programs to preserve the screen contents. When activated, it saves a copy of the visible grid and disables scrolling into and resizing out of the history; when deactivated the visible data is restored and the history reenabled. Nicholas Marriott 2009-07-14 06:40:33 +00:00
  • f41ef2198b Missed this declaration in key bindings change. Whoops. Nicholas Marriott 2009-07-14 06:40:03 +00:00
  • 61bd3ae1c6 Document the -k flag to new-window. Nicholas Marriott 2009-07-14 06:39:44 +00:00
  • 5ef5bd7c31 Add a "back to indentation" key in copy mode to move the cursor to the first non-whitespace character. ^ with vi and M-m with emacs key bindings. Another from Kalle Olavi Niemitalo, thanks. Nicholas Marriott 2009-07-14 06:39:25 +00:00
  • 7f98193beb Merge three copies of identical code to move the cursor x position into a single function, from Kalle Olavi Niemitalo. Nicholas Marriott 2009-07-14 06:38:32 +00:00
  • d2c3dbc665 If it exist, load a system-wide configuration file /etc/tmux.conf before any user-specified one. Nicholas Marriott 2009-07-14 06:38:14 +00:00
  • ceace9c6bd Since tmux doesn't actually need ncurses, use -lcurses/curses.h instead. Pointed out by millert a while ago. Nicholas Marriott 2009-07-14 06:30:45 +00:00
  • 5f108d9df6 Having fixed flags for single-character getopt options is a bit hard to maintain and is only going to get worse as more are used. So instead, add a new uint64_t member to cmd_entry which is a bitmask of upper and lowercase options accepted by the command. Nicholas Marriott 2009-07-13 23:11:35 +00:00
  • 5d91555c7c zap trailing whitespace; Jason McIntyre 2009-07-13 20:14:23 +00:00
  • cba885a67c Expand leading tildes in arguments, from Tiage Cunha. Nicholas Marriott 2009-07-13 18:49:36 +00:00
  • cf411053c7 copy-mode and scroll-mode have a -u flag missing from usage, add it. Nicholas Marriott 2009-07-13 18:44:17 +00:00
  • 2f75b07d08 Update. Tiago Cunha 2009-07-13 18:29:28 +00:00
  • 280619a4e8 Expand leading tilde on commands which expect a filename. Tiago Cunha 2009-07-13 18:03:18 +00:00
  • 023d8d38ec Tidy up and improve target (-t) argument parsing: Nicholas Marriott 2009-07-13 17:47:46 +00:00
  • 6db6df882c Update. Nicholas Marriott 2009-07-13 11:33:06 +00:00
  • 359285928b Support "alternate screen" mode (terminfo smcup/rmcup) typically used by full screen interactive programs to preserve the screen contents. When activated, it saves a copy of the visible grid and disables scrolling into and resizing out of the history; when deactivated the visible data is restored and the history reenabled. Nicholas Marriott 2009-07-13 10:43:52 +00:00
  • db411ca515 Update TODO. Nicholas Marriott 2009-07-13 06:29:19 +00:00
  • 0b788a3d61 Missed this declaration in key bindings change. Whoops. Nicholas Marriott 2009-07-12 23:46:49 +00:00
  • 88555d96d5 Document the -k flag to new-window. Nicholas Marriott 2009-07-12 23:45:03 +00:00
  • 9e49ec6cd3 Creating a key binding which replaces itself (such as "bind x bind x lsw") frees the command list bound to the key while it is still being executed, leading to a use after free. To prevent this, create a dead keys list and defer freeing replaced or removed key bindings until the main loop when the key binding will have finished executing. Nicholas Marriott 2009-07-12 17:33:18 +00:00
  • 3fb3613d34 Limit the history to hlimit not hlimit - 1. This makes a history-limit setting of 0 work as expected. Nicholas Marriott 2009-07-12 17:12:41 +00:00
  • 30f47dfc5e Add -r to the synopsis of the paste-buffer command, prompted by jmc. Nicholas Marriott 2009-07-12 17:12:06 +00:00
  • 27fc963631 When pasting, translate \n into \r. This matches xterm and putty's behaviour, and makes emacs happy when pasting into some modes. A new -r (raw) flag to paste-buffer pastes without the translation. Nicholas Marriott 2009-07-12 17:11:39 +00:00
  • d8de72ca77 Copy was using the real line length which after resize can be larger than the screen width. When built with -DDEBUG, this made the grid bounds checking code kill the server. Restrict copying to the actual width. Nicholas Marriott 2009-07-12 17:11:07 +00:00
  • ef5f356da2 paste-buffer -d was not documented. From Kalle Olavi Niemitalo. Nicholas Marriott 2009-07-12 17:10:35 +00:00
  • 1919deab1f Redraw the status line after renaming a session (it may contain the name). Nicholas Marriott 2009-07-12 17:09:15 +00:00
  • fd0971542f Don't send initialisation strings is1/2/3 (barely anything else does) and move smcup to the first and rmcup to the last sequences output to the terminal. This allows tmux to use the alternate screen (smcup/rmcup) when available. Nicholas Marriott 2009-07-12 17:08:37 +00:00
  • d7b4aa0ff3 Add a default-terminal option to set the starting value of $TERM in new windows. Nicholas Marriott 2009-07-12 17:07:58 +00:00
  • 79bc6041c9 Document display-time option which seems to have been missed. Nicholas Marriott 2009-07-12 17:04:21 +00:00
  • 8be8016a76 When the terminal size is reduced horizontally, don't truncate lines to the new width, so that if the same lines are later increased in size the content reappears. Nicholas Marriott 2009-07-12 17:03:11 +00:00
  • d4a143a425 Stop in the right place so all the lines selected are copied. Reported by Kalle Olavi Niemitalo, thanks. Nicholas Marriott 2009-07-12 16:56:56 +00:00
  • 22d51ec1ea Add a "back to indentation" key in copy mode to move the cursor to the first non-whitespace character. ^ with vi and M-m with emacs key bindings. Another from Kalle Olavi Niemitalo, thanks. Nicholas Marriott 2009-07-12 16:15:34 +00:00
  • fa8333eddb Merge three copies of identical code to move the cursor x position into a single function, from Kalle Olavi Niemitalo. Nicholas Marriott 2009-07-12 16:12:34 +00:00
  • 22355ce947 If it exist, load a system-wide configuration file /etc/tmux.conf before any user-specified one. Nicholas Marriott 2009-07-12 16:07:56 +00:00
  • bd098c273b Limit the history to hlimit not hlimit - 1. This makes a history-limit setting of 0 work as expected. Nicholas Marriott 2009-07-11 20:11:18 +00:00
  • e415ead361 Add -r to the synopsis of the paste-buffer command, prompted by jmc. Nicholas Marriott 2009-07-11 20:04:19 +00:00
  • bf0f56d04e Update TODO. Nicholas Marriott 2009-07-11 19:25:53 +00:00
  • 2f7198246e When pasting, translate \n into \r. This matches xterm and putty's behaviour, and makes emacs happy when pasting into some modes. A new -r (raw) flag to paste-buffer pastes without the translation. Nicholas Marriott 2009-07-11 19:14:56 +00:00
  • 289320a9b1 Copy was using the real line length which after resize can be larger than the screen width. When built with -DDEBUG, this made the grid bounds checking code kill the server. Restrict copying to the actual width. Nicholas Marriott 2009-07-11 19:09:24 +00:00
  • 0e7c6bdcc7 Update TODO. Nicholas Marriott 2009-07-11 13:48:05 +00:00
  • 4cbbbddf22 paste-buffer -d was not documented. From Kalle Olavi Niemitalo. Nicholas Marriott 2009-07-10 19:01:40 +00:00
  • 9cd5ba40d3 Redraw the status line after renaming a session (it may contain the name). Nicholas Marriott 2009-07-10 17:34:51 +00:00
  • 4a6d62e401 Don't send initialisation strings is1/2/3 (barely anything else does) and move smcup to the first and rmcup to the last sequences output to the terminal. This allows tmux to use the alternate screen (smcup/rmcup) when available. Nicholas Marriott 2009-07-10 07:11:59 +00:00
  • daa1faa905 Add a default-terminal option to set the starting value of $TERM in new windows. Nicholas Marriott 2009-07-10 05:50:54 +00:00
  • 25d5734496 Document display-time option which seems to have been missed. Nicholas Marriott 2009-07-10 05:43:01 +00:00
  • 58361eb965 When the terminal size is reduced horizontally, don't truncate lines to the new width, so that if the same lines are later increased in size the content reappears. Nicholas Marriott 2009-07-09 22:48:20 +00:00
  • 7e8ff69a14 Fix $Id$. Nicholas Marriott 2009-07-09 18:16:36 +00:00
  • eee3dd297e New command, if-shell (alias if). Executes the tmux command in the second argument if the shell command in the first succeeds, for example: Nicholas Marriott 2009-07-09 18:14:18 +00:00
  • 5afe17d147 Fix $Id$. Nicholas Marriott 2009-07-09 18:08:29 +00:00
  • 664a0bd559 Cursor up and down should be limited by the scroll region (cuu should stop at the scroll region top if starting from below it and cud stop at the bottom if starting from above). Fixes another vttest test. Nicholas Marriott 2009-07-09 18:08:13 +00:00
  • 4422b958c3 Don't leak FILE * on malloc failure. From ivoire at users dot sourceforge dot net. Nicholas Marriott 2009-07-09 18:05:17 +00:00
  • 295879cced Change inserting and deleting lines inside the scroll region to properly clear lines that should be inserted/deleted but not moved. Fixes problems with mutt reported by Brian Lewis, thanks. Nicholas Marriott 2009-07-09 18:04:53 +00:00
  • e073441c36 Tidy by removing unused argument from grid_view_{insert,delete}_line_region functions (currently don't fully work, this is to make fix easier). Nicholas Marriott 2009-07-09 18:04:17 +00:00
  • 27e9f77a49 Fix two memory leaks when assigning shell variables in configuration file/command prompt. From Tiago Cunha. Nicholas Marriott 2009-07-09 18:03:28 +00:00
  • f8ea82d7dc Update TODO list. Nicholas Marriott 2009-07-09 17:58:54 +00:00
  • 5f2f07ed8a Cursor up and down should be limited by the scroll region (cuu should stop at the scroll region top if starting from below it and cud stop at the bottom if starting from above). Fixes another vttest test. Nicholas Marriott 2009-07-09 17:57:11 +00:00
  • 81181bfb72 New command, if-shell (alias if). Executes the tmux command in the second argument if the shell command in the first succeeds, for example: Nicholas Marriott 2009-07-09 15:47:49 +00:00
  • 24e1327d0d Stop in the right place so all the lines selected are copied. Reported by Kalle Olavi Niemitalo, thanks. Nicholas Marriott 2009-07-09 15:02:00 +00:00
  • 29f9d5f335 Don't leak FILE * on malloc failure. From ivoire at users dot sourceforge dot net. Nicholas Marriott 2009-07-09 09:54:56 +00:00
  • 86c93c6e34 Change inserting and deleting lines inside the scroll region to properly clear lines that should be inserted/deleted but not moved. Fixes problems with mutt reported by Brian Lewis, thanks. Nicholas Marriott 2009-07-09 07:58:14 +00:00
  • 643c219d18 Tidy by removing unused argument from grid_view_{insert,delete}_line_region functions (currently don't fully work, this is to make fix easier). Nicholas Marriott 2009-07-09 00:29:32 +00:00
  • 890db6eaaf Accidently deleted default-command. Nicholas Marriott 2009-07-08 18:12:57 +00:00
  • 99395856ff Bring spacing into line. Nicholas Marriott 2009-07-08 18:07:09 +00:00
  • 9cf68ac868 Whoops, that shouldn't have been there. Nicholas Marriott 2009-07-08 18:05:33 +00:00
  • 2ddcb51df3 Fix $Id$. Nicholas Marriott 2009-07-08 18:03:03 +00:00
  • 9875be3327 When reinitialising the screen, do not omit to clear the last line. Nicholas Marriott 2009-07-08 18:02:31 +00:00