mirror of
https://github.com/tmux/tmux.git
synced 2026-03-12 11:35:46 +00:00
Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a33a12798 | ||
|
|
d0fa520788 | ||
|
|
646bfe403e | ||
|
|
650d38962f | ||
|
|
ccd7368cc5 | ||
|
|
9077b212c3 | ||
|
|
a4e19bcd80 | ||
|
|
bc36b473f1 | ||
|
|
10975961de | ||
|
|
8d2af4fb54 | ||
|
|
ac050b2583 | ||
|
|
3234017260 | ||
|
|
938ad5a98c | ||
|
|
9f378a163f | ||
|
|
a5922546ac | ||
|
|
3476eccf48 | ||
|
|
0dbf414578 | ||
|
|
8dedccaa20 | ||
|
|
e5fd85415d | ||
|
|
af4b62d10b | ||
|
|
0c06409c9d | ||
|
|
617136c234 | ||
|
|
f16085a362 | ||
|
|
4ffbebedce | ||
|
|
c0d74661b7 | ||
|
|
b21a9b1c4e | ||
|
|
444e9f3c58 | ||
|
|
59cb022c42 | ||
|
|
2991f4aad0 | ||
|
|
9e4d0b2b6d | ||
|
|
add75a06cd | ||
|
|
ccd24c9cb2 | ||
|
|
8be179de46 | ||
|
|
f65b9c0d36 | ||
|
|
549b3599ef | ||
|
|
4694afbed4 | ||
|
|
229be034fb | ||
|
|
ba542e42b7 | ||
|
|
b20753f2a3 | ||
|
|
22e9cf04ca | ||
|
|
37919a6b6a | ||
|
|
fdbc1116ef | ||
|
|
0c6c8c4efc | ||
|
|
a1f6bd55b6 | ||
|
|
c391d50cbb | ||
|
|
58b47bf01b | ||
|
|
9900ccd04e | ||
|
|
24cd726dae | ||
|
|
6c28d0dd06 | ||
|
|
f48b041cf2 | ||
|
|
a4d8437bc2 | ||
|
|
dc882adb2e | ||
|
|
470cba356d | ||
|
|
ae9ca620bd | ||
|
|
400750bb26 | ||
|
|
096f0d35a6 | ||
|
|
54553903de | ||
|
|
fb29242168 | ||
|
|
c915cfc7e4 | ||
|
|
3ad4a7a571 | ||
|
|
47174f5130 | ||
|
|
4822130b3c | ||
|
|
0bf153daa6 |
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@@ -14,8 +14,8 @@ Before opening an issue, please ensure that:
|
|||||||
- Your question or issue is not covered [in the
|
- Your question or issue is not covered [in the
|
||||||
manual](https://man.openbsd.org/tmux.1) (run `man tmux`).
|
manual](https://man.openbsd.org/tmux.1) (run `man tmux`).
|
||||||
|
|
||||||
- Your problem is not mentioned in the [CHANGES
|
- Your problem is not mentioned in [the CHANGES
|
||||||
file](https://raw.githubusercontent.com/tmux/tmux/master/CHANGES) file.
|
file](https://raw.githubusercontent.com/tmux/tmux/master/CHANGES).
|
||||||
|
|
||||||
- Nobody else has opened the same issue recently.
|
- Nobody else has opened the same issue recently.
|
||||||
|
|
||||||
|
|||||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1 +1,2 @@
|
|||||||
|
github: nicm
|
||||||
liberapay: tmux
|
liberapay: tmux
|
||||||
|
|||||||
10
.github/lock.yml
vendored
Normal file
10
.github/lock.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
daysUntilLock: 180
|
||||||
|
skipCreatedBefore: false
|
||||||
|
exemptLabels: []
|
||||||
|
lockLabel: false
|
||||||
|
lockComment: >
|
||||||
|
This thread has been automatically locked since there has not been
|
||||||
|
any recent activity after it was closed. Please open a new issue for
|
||||||
|
related bugs.
|
||||||
|
setLockReason: false
|
||||||
|
#only: issues
|
||||||
84
CHANGES
84
CHANGES
@@ -1,4 +1,37 @@
|
|||||||
CHANGES FROM 3.0 to 3.1
|
CHANGES FROM 3.1a TO 3.1b
|
||||||
|
|
||||||
|
* Fix crash when allow-rename is on and an empty name is set.
|
||||||
|
|
||||||
|
CHANGES FROM 3.1 TO 3.1a
|
||||||
|
|
||||||
|
* Do not close stdout prematurely in control mode since it is needed to print
|
||||||
|
exit messages. Prevents hanging when detaching with iTerm2.
|
||||||
|
|
||||||
|
CHANGES FROM 3.0a TO 3.1
|
||||||
|
|
||||||
|
* Only search the visible part of the history when marking (highlighting)
|
||||||
|
search terms. This is much faster than searching the whole history and solves
|
||||||
|
problems with large histories. The count of matches shown is now the visible
|
||||||
|
matches rather than all matches.
|
||||||
|
|
||||||
|
* Search using regular expressions in copy mode. search-forward and
|
||||||
|
search-backward use regular expressions by default; the incremental versions
|
||||||
|
do not.
|
||||||
|
|
||||||
|
* Turn off mouse mode 1003 as well as the rest when exiting.
|
||||||
|
|
||||||
|
* Add selection_active format for when the selection is present but not moving
|
||||||
|
with the cursor.
|
||||||
|
|
||||||
|
* Fix dragging with modifier keys, so binding keys such as C-MouseDrag1Pane and
|
||||||
|
C-MouseDragEnd1Pane now work.
|
||||||
|
|
||||||
|
* Add -a to list-keys to also list keys without notes with -N.
|
||||||
|
|
||||||
|
* Do not jump to next word end if already on a word end when selecting a word;
|
||||||
|
fixes select-word with single character words and vi(1) keys.
|
||||||
|
|
||||||
|
* Fix top and bottom pane calculation with pane border status enabled.
|
||||||
|
|
||||||
* Add support for adding a note to a key binding (with bind-key -N) and use
|
* Add support for adding a note to a key binding (with bind-key -N) and use
|
||||||
this to add descriptions to the default key bindings. A new -N flag to
|
this to add descriptions to the default key bindings. A new -N flag to
|
||||||
@@ -10,7 +43,7 @@ CHANGES FROM 3.0 to 3.1
|
|||||||
* Add support for the iTerm2 DSR 1337 sequence to get the terminal version.
|
* Add support for the iTerm2 DSR 1337 sequence to get the terminal version.
|
||||||
|
|
||||||
* Treat plausible but invalid keys (like C-BSpace) as literal like any other
|
* Treat plausible but invalid keys (like C-BSpace) as literal like any other
|
||||||
unrecognised string passed to send-keys
|
unrecognised string passed to send-keys.
|
||||||
|
|
||||||
* Detect iTerm2 and enable use of DECSLRM (much faster with horizontally split
|
* Detect iTerm2 and enable use of DECSLRM (much faster with horizontally split
|
||||||
windows).
|
windows).
|
||||||
@@ -42,11 +75,6 @@ CHANGES FROM 3.0 to 3.1
|
|||||||
|
|
||||||
* Add push-default to status-left and status-right in status-format[0].
|
* Add push-default to status-left and status-right in status-format[0].
|
||||||
|
|
||||||
* Add -F flag to send-keys to expand formats in search-backward and forward
|
|
||||||
copy mode commands and copy_cursor_word and copy_cursor_line formats for word
|
|
||||||
and line at cursor in copy mode. Use for default # and * binding with vi(1)
|
|
||||||
keys.
|
|
||||||
|
|
||||||
* Do not clear search marks on cursor movement with vi(1) keys.
|
* Do not clear search marks on cursor movement with vi(1) keys.
|
||||||
|
|
||||||
* Add p format modifier for padding to width and allow multiple substitutions
|
* Add p format modifier for padding to width and allow multiple substitutions
|
||||||
@@ -54,29 +82,9 @@ CHANGES FROM 3.0 to 3.1
|
|||||||
|
|
||||||
* Add -f for full size to join-pane (like split-window).
|
* Add -f for full size to join-pane (like split-window).
|
||||||
|
|
||||||
* Handle OSC 7 (a VTE extension) and put the result in a new format (pane_path).
|
|
||||||
|
|
||||||
* Change new-session -A without a session name (that is, no -s option also) to
|
|
||||||
attach to the best existing session like attach-session rather than creating
|
|
||||||
a new one.
|
|
||||||
|
|
||||||
* Add an option to set the key sent by backspace for those whose system uses ^H
|
|
||||||
rather than ^?.
|
|
||||||
|
|
||||||
* Add formats for cursor and selection position in copy mode.
|
|
||||||
|
|
||||||
* Add support for percentage sizes for resize-pane ("-x 10%"). Also change
|
|
||||||
split-window and join-pane -l to accept similar percentages and no longer
|
|
||||||
document -p.
|
|
||||||
|
|
||||||
* Make select-pane -P set window-active-style also to match previous behaviour.
|
|
||||||
|
|
||||||
* Do not use bright when emulating 256 colours on an 8 colour terminal because
|
* Do not use bright when emulating 256 colours on an 8 colour terminal because
|
||||||
it is also bold on some terminals.
|
it is also bold on some terminals.
|
||||||
|
|
||||||
* Add a "latest" window-size option which tries to size windows based on the
|
|
||||||
most recently used client. This is now the default.
|
|
||||||
|
|
||||||
* Make select-pane -P set window-active-style also to match previous behaviour.
|
* Make select-pane -P set window-active-style also to match previous behaviour.
|
||||||
|
|
||||||
* Do not truncate list-keys output.
|
* Do not truncate list-keys output.
|
||||||
@@ -89,17 +97,18 @@ CHANGES FROM 3.0 to 3.1
|
|||||||
-p flag.
|
-p flag.
|
||||||
|
|
||||||
* Add -F flag to send-keys to expand formats in search-backward and forward
|
* Add -F flag to send-keys to expand formats in search-backward and forward
|
||||||
copy mode commands, this makes it easier to use the cursor_word and
|
copy mode commands and copy_cursor_word and copy_cursor_line formats for word
|
||||||
cursor_line formats.
|
and line at cursor in copy mode. Use for default # and * binding with vi(1)
|
||||||
|
keys.
|
||||||
|
|
||||||
* Add formats for word and line at cursor position in copy mode.
|
* Add formats for word and line at cursor position in copy mode.
|
||||||
|
|
||||||
* Add formats for cursor and selection position in copy mode
|
* Add formats for cursor and selection position in copy mode.
|
||||||
|
|
||||||
* Support all the forms of RGB colour strings in OSC sequences rather than
|
* Support all the forms of RGB colour strings in OSC sequences rather than
|
||||||
requiring two digits.
|
requiring two digits.
|
||||||
|
|
||||||
* Limit lazy resize to panes in attached sessions only
|
* Limit lazy resize to panes in attached sessions only.
|
||||||
|
|
||||||
* Add an option to set the key sent by backspace for those whose system uses ^H
|
* Add an option to set the key sent by backspace for those whose system uses ^H
|
||||||
rather than ^?.
|
rather than ^?.
|
||||||
@@ -108,7 +117,8 @@ CHANGES FROM 3.0 to 3.1
|
|||||||
attach to the best existing session like attach-session rather than a new
|
attach to the best existing session like attach-session rather than a new
|
||||||
one.
|
one.
|
||||||
|
|
||||||
* Change window-size default from smallest to latest.
|
* Add a "latest" window-size option which tries to size windows based on the
|
||||||
|
most recently used client. This is now the default.
|
||||||
|
|
||||||
* Add simple support for OSC 7 (result is available in the pane_path format).
|
* Add simple support for OSC 7 (result is available in the pane_path format).
|
||||||
|
|
||||||
@@ -130,7 +140,7 @@ CHANGES FROM 3.0 to 3.1
|
|||||||
|
|
||||||
* Add reverse sorting in tree, client and buffer modes.
|
* Add reverse sorting in tree, client and buffer modes.
|
||||||
|
|
||||||
CHANGES FROM 3.0 to 3.0a
|
CHANGES FROM 3.0 TO 3.0a
|
||||||
|
|
||||||
* Do not require REG_STARTEND.
|
* Do not require REG_STARTEND.
|
||||||
|
|
||||||
@@ -144,7 +154,7 @@ CHANGES FROM 3.0 to 3.0a
|
|||||||
|
|
||||||
* Do not crash when restoring a layout with only one pane.
|
* Do not crash when restoring a layout with only one pane.
|
||||||
|
|
||||||
CHANGES FROM 2.9 to 3.0
|
CHANGES FROM 2.9 TO 3.0
|
||||||
|
|
||||||
* Workaround invalid layout strings generated by older tmux versions and add
|
* Workaround invalid layout strings generated by older tmux versions and add
|
||||||
some additional sanity checks
|
some additional sanity checks
|
||||||
@@ -269,11 +279,11 @@ CHANGES FROM 2.9 to 3.0
|
|||||||
* Add the ability to infer an option type (server, session, window) from its
|
* Add the ability to infer an option type (server, session, window) from its
|
||||||
name to show-options (it was already present in set-option).
|
name to show-options (it was already present in set-option).
|
||||||
|
|
||||||
CHANGES FROM 2.9 to 2.9a
|
CHANGES FROM 2.9 TO 2.9a
|
||||||
|
|
||||||
* Fix bugs in select-pane and the main-horizontal and main-vertical layouts.
|
* Fix bugs in select-pane and the main-horizontal and main-vertical layouts.
|
||||||
|
|
||||||
CHANGES FROM 2.8 to 2.9
|
CHANGES FROM 2.8 TO 2.9
|
||||||
|
|
||||||
* Attempt to preserve horizontal cursor position as well as vertical with
|
* Attempt to preserve horizontal cursor position as well as vertical with
|
||||||
reflow.
|
reflow.
|
||||||
@@ -398,7 +408,7 @@ CHANGES FROM 2.8 to 2.9
|
|||||||
moves up, down, left or right and -c returns to automatic cursor
|
moves up, down, left or right and -c returns to automatic cursor
|
||||||
tracking. The position is reset when the current window is changed.
|
tracking. The position is reset when the current window is changed.
|
||||||
|
|
||||||
CHANGES FROM 2.7 to 2.8
|
CHANGES FROM 2.7 TO 2.8
|
||||||
|
|
||||||
* Make display-panes block the client until a pane is chosen or it
|
* Make display-panes block the client until a pane is chosen or it
|
||||||
times out.
|
times out.
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ args_parse(const char *template, int argc, char **argv)
|
|||||||
|
|
||||||
optreset = 1;
|
optreset = 1;
|
||||||
optind = 1;
|
optind = 1;
|
||||||
|
optarg = NULL;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, template)) != -1) {
|
while ((opt = getopt(argc, argv, template)) != -1) {
|
||||||
if (opt < 0)
|
if (opt < 0)
|
||||||
@@ -83,6 +84,7 @@ args_parse(const char *template, int argc, char **argv)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
args_set(args, opt, optarg);
|
args_set(args, opt, optarg);
|
||||||
|
optarg = NULL;
|
||||||
}
|
}
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|||||||
5
client.c
5
client.c
@@ -523,7 +523,7 @@ client_write_open(void *data, size_t datalen)
|
|||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
else {
|
else {
|
||||||
cf->fd = dup(msg->fd);
|
cf->fd = dup(msg->fd);
|
||||||
if (client_flags & CLIENT_CONTROL)
|
if (~client_flags & CLIENT_CONTROL)
|
||||||
close(msg->fd); /* can only be used once */
|
close(msg->fd); /* can only be used once */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -678,7 +678,8 @@ client_read_open(void *data, size_t datalen)
|
|||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
else {
|
else {
|
||||||
cf->fd = dup(msg->fd);
|
cf->fd = dup(msg->fd);
|
||||||
close(msg->fd); /* can only be used once */
|
if (~client_flags & CLIENT_CONTROL)
|
||||||
|
close(msg->fd); /* can only be used once */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cf->fd == -1) {
|
if (cf->fd == -1) {
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ const struct cmd_entry cmd_copy_mode_entry = {
|
|||||||
.name = "copy-mode",
|
.name = "copy-mode",
|
||||||
.alias = NULL,
|
.alias = NULL,
|
||||||
|
|
||||||
.args = { "Met:u", 0, 0 },
|
.args = { "eHMt:uq", 0, 0 },
|
||||||
.usage = "[-Mu] " CMD_TARGET_PANE_USAGE,
|
.usage = "[-eHMuq] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
|
||||||
@@ -61,6 +61,11 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
struct session *s;
|
struct session *s;
|
||||||
struct window_pane *wp = item->target.wp;
|
struct window_pane *wp = item->target.wp;
|
||||||
|
|
||||||
|
if (args_has(args, 'q')) {
|
||||||
|
window_pane_reset_mode_all(wp);
|
||||||
|
return (CMD_RETURN_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
if (args_has(args, 'M')) {
|
if (args_has(args, 'M')) {
|
||||||
if ((wp = cmd_mouse_pane(&shared->mouse, &s, NULL)) == NULL)
|
if ((wp = cmd_mouse_pane(&shared->mouse, &s, NULL)) == NULL)
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ const struct cmd_entry cmd_list_keys_entry = {
|
|||||||
.name = "list-keys",
|
.name = "list-keys",
|
||||||
.alias = "lsk",
|
.alias = "lsk",
|
||||||
|
|
||||||
.args = { "1NP:T:", 0, 1 },
|
.args = { "1aNP:T:", 0, 1 },
|
||||||
.usage = "[-1N] [-P prefix-string] [-T key-table] [key]",
|
.usage = "[-1aN] [-P prefix-string] [-T key-table] [key]",
|
||||||
|
|
||||||
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_keys_exec
|
.exec = cmd_list_keys_exec
|
||||||
@@ -47,8 +47,8 @@ const struct cmd_entry cmd_list_commands_entry = {
|
|||||||
.name = "list-commands",
|
.name = "list-commands",
|
||||||
.alias = "lscm",
|
.alias = "lscm",
|
||||||
|
|
||||||
.args = { "F:", 0, 0 },
|
.args = { "F:", 0, 1 },
|
||||||
.usage = "[-F format]",
|
.usage = "[-F format] [command]",
|
||||||
|
|
||||||
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_keys_exec
|
.exec = cmd_list_keys_exec
|
||||||
@@ -89,7 +89,7 @@ cmd_list_keys_print_notes(struct cmdq_item *item, struct args *args,
|
|||||||
struct key_table *table;
|
struct key_table *table;
|
||||||
struct key_binding *bd;
|
struct key_binding *bd;
|
||||||
const char *key;
|
const char *key;
|
||||||
char *tmp;
|
char *tmp, *note;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
table = key_bindings_get_table(tablename, 0);
|
table = key_bindings_get_table(tablename, 0);
|
||||||
@@ -99,19 +99,24 @@ cmd_list_keys_print_notes(struct cmdq_item *item, struct args *args,
|
|||||||
while (bd != NULL) {
|
while (bd != NULL) {
|
||||||
if ((only != KEYC_UNKNOWN && bd->key != only) ||
|
if ((only != KEYC_UNKNOWN && bd->key != only) ||
|
||||||
KEYC_IS_MOUSE(bd->key) ||
|
KEYC_IS_MOUSE(bd->key) ||
|
||||||
bd->note == NULL) {
|
(bd->note == NULL && !args_has(args, 'a'))) {
|
||||||
bd = key_bindings_next(table, bd);
|
bd = key_bindings_next(table, bd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
found = 1;
|
found = 1;
|
||||||
key = key_string_lookup_key(bd->key);
|
key = key_string_lookup_key(bd->key);
|
||||||
|
|
||||||
|
if (bd->note == NULL)
|
||||||
|
note = cmd_list_print(bd->cmdlist, 1);
|
||||||
|
else
|
||||||
|
note = xstrdup(bd->note);
|
||||||
tmp = utf8_padcstr(key, keywidth + 1);
|
tmp = utf8_padcstr(key, keywidth + 1);
|
||||||
if (args_has(args, '1') && c != NULL)
|
if (args_has(args, '1') && c != NULL)
|
||||||
status_message_set(c, "%s%s%s", prefix, tmp, bd->note);
|
status_message_set(c, "%s%s%s", prefix, tmp, note);
|
||||||
else
|
else
|
||||||
cmdq_print(item, "%s%s%s", prefix, tmp, bd->note);
|
cmdq_print(item, "%s%s%s", prefix, tmp, note);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
free(note);
|
||||||
|
|
||||||
if (args_has(args, '1'))
|
if (args_has(args, '1'))
|
||||||
break;
|
break;
|
||||||
@@ -312,9 +317,12 @@ cmd_list_keys_commands(struct cmd *self, struct cmdq_item *item)
|
|||||||
const struct cmd_entry **entryp;
|
const struct cmd_entry **entryp;
|
||||||
const struct cmd_entry *entry;
|
const struct cmd_entry *entry;
|
||||||
struct format_tree *ft;
|
struct format_tree *ft;
|
||||||
const char *template, *s;
|
const char *template, *s, *command = NULL;
|
||||||
char *line;
|
char *line;
|
||||||
|
|
||||||
|
if (args->argc != 0)
|
||||||
|
command = args->argv[0];
|
||||||
|
|
||||||
if ((template = args_get(args, 'F')) == NULL) {
|
if ((template = args_get(args, 'F')) == NULL) {
|
||||||
template = "#{command_list_name}"
|
template = "#{command_list_name}"
|
||||||
"#{?command_list_alias, (#{command_list_alias}),} "
|
"#{?command_list_alias, (#{command_list_alias}),} "
|
||||||
@@ -326,6 +334,11 @@ cmd_list_keys_commands(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
for (entryp = cmd_table; *entryp != NULL; entryp++) {
|
for (entryp = cmd_table; *entryp != NULL; entryp++) {
|
||||||
entry = *entryp;
|
entry = *entryp;
|
||||||
|
if (command != NULL &&
|
||||||
|
(strcmp(entry->name, command) != 0 &&
|
||||||
|
(entry->alias == NULL ||
|
||||||
|
strcmp(entry->alias, command) != 0)))
|
||||||
|
continue;
|
||||||
|
|
||||||
format_add(ft, "command_list_name", "%s", entry->name);
|
format_add(ft, "command_list_name", "%s", entry->name);
|
||||||
if (entry->alias != NULL)
|
if (entry->alias != NULL)
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (args_has(args, 'P')) {
|
if (args_has(args, 'P')) {
|
||||||
if ((template = args_get(args, 'F')) == NULL)
|
if ((template = args_get(args, 'F')) == NULL)
|
||||||
template = NEW_SESSION_TEMPLATE;
|
template = NEW_SESSION_TEMPLATE;
|
||||||
cp = format_single(item, template, c, s, NULL, NULL);
|
cp = format_single(item, template, c, s, s->curw, NULL);
|
||||||
cmdq_print(item, "%s", cp);
|
cmdq_print(item, "%s", cp);
|
||||||
free(cp);
|
free(cp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (args_has(args, 'P')) {
|
if (args_has(args, 'P')) {
|
||||||
if ((template = args_get(args, 'F')) == NULL)
|
if ((template = args_get(args, 'F')) == NULL)
|
||||||
template = NEW_WINDOW_TEMPLATE;
|
template = NEW_WINDOW_TEMPLATE;
|
||||||
cp = format_single(item, template, c, s, new_wl, NULL);
|
cp = format_single(item, template, c, s, new_wl,
|
||||||
|
new_wl->window->active);
|
||||||
cmdq_print(item, "%s", cp);
|
cmdq_print(item, "%s", cp);
|
||||||
free(cp);
|
free(cp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,10 +59,6 @@ cmdq_append(struct client *c, struct cmdq_item *item)
|
|||||||
struct cmdq_list *queue = cmdq_get(c);
|
struct cmdq_list *queue = cmdq_get(c);
|
||||||
struct cmdq_item *next;
|
struct cmdq_item *next;
|
||||||
|
|
||||||
TAILQ_FOREACH(next, queue, entry) {
|
|
||||||
log_debug("%s %s: queue %s (%u)", __func__, cmdq_name(c),
|
|
||||||
next->name, next->group);
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
next = item->next;
|
next = item->next;
|
||||||
item->next = NULL;
|
item->next = NULL;
|
||||||
@@ -88,10 +84,6 @@ cmdq_insert_after(struct cmdq_item *after, struct cmdq_item *item)
|
|||||||
struct cmdq_list *queue = after->queue;
|
struct cmdq_list *queue = after->queue;
|
||||||
struct cmdq_item *next;
|
struct cmdq_item *next;
|
||||||
|
|
||||||
TAILQ_FOREACH(next, queue, entry) {
|
|
||||||
log_debug("%s %s: queue %s (%u)", __func__, cmdq_name(c),
|
|
||||||
next->name, next->group);
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
next = item->next;
|
next = item->next;
|
||||||
item->next = after->next;
|
item->next = after->next;
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
sc.flags |= SPAWN_DETACHED;
|
sc.flags |= SPAWN_DETACHED;
|
||||||
|
|
||||||
if ((new_wp = spawn_pane(&sc, &cause)) == NULL) {
|
if ((new_wp = spawn_pane(&sc, &cause)) == NULL) {
|
||||||
layout_close_pane(new_wp);
|
|
||||||
cmdq_error(item, "create pane failed: %s", cause);
|
cmdq_error(item, "create pane failed: %s", cause);
|
||||||
free(cause);
|
free(cause);
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
|
|||||||
@@ -142,10 +142,11 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
session_update_activity(s, NULL);
|
session_update_activity(s, NULL);
|
||||||
gettimeofday(&s->last_attached_time, NULL);
|
gettimeofday(&s->last_attached_time, NULL);
|
||||||
|
|
||||||
recalculate_sizes();
|
|
||||||
server_check_unattached();
|
server_check_unattached();
|
||||||
server_redraw_client(c);
|
server_redraw_client(c);
|
||||||
s->curw->flags &= ~WINLINK_ALERTFLAGS;
|
s->curw->flags &= ~WINLINK_ALERTFLAGS;
|
||||||
|
s->curw->window->latest = c;
|
||||||
|
recalculate_sizes();
|
||||||
alerts_check_session(s);
|
alerts_check_session(s);
|
||||||
|
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
|
|||||||
2
compat.h
2
compat.h
@@ -370,7 +370,6 @@ int utf8proc_mbtowc(wchar_t *, const char *, size_t);
|
|||||||
int utf8proc_wctomb(char *, wchar_t);
|
int utf8proc_wctomb(char *, wchar_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GETOPT
|
|
||||||
/* getopt.c */
|
/* getopt.c */
|
||||||
extern int BSDopterr;
|
extern int BSDopterr;
|
||||||
extern int BSDoptind;
|
extern int BSDoptind;
|
||||||
@@ -384,6 +383,5 @@ int BSDgetopt(int, char *const *, const char *);
|
|||||||
#define optopt BSDoptopt
|
#define optopt BSDoptopt
|
||||||
#define optreset BSDoptreset
|
#define optreset BSDoptreset
|
||||||
#define optarg BSDoptarg
|
#define optarg BSDoptarg
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* COMPAT_H */
|
#endif /* COMPAT_H */
|
||||||
|
|||||||
42
configure.ac
42
configure.ac
@@ -1,6 +1,6 @@
|
|||||||
# configure.ac
|
# configure.ac
|
||||||
|
|
||||||
AC_INIT([tmux], 3.1-rc)
|
AC_INIT([tmux], 3.1b)
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR(etc)
|
AC_CONFIG_AUX_DIR(etc)
|
||||||
@@ -125,6 +125,12 @@ AC_FUNC_STRNLEN
|
|||||||
# Look for clock_gettime. Must come before event_init.
|
# Look for clock_gettime. Must come before event_init.
|
||||||
AC_SEARCH_LIBS(clock_gettime, rt)
|
AC_SEARCH_LIBS(clock_gettime, rt)
|
||||||
|
|
||||||
|
# Always use our getopt because 1) glibc's doesn't enforce argument order 2)
|
||||||
|
# musl does not set optarg to NULL for flags without arguments (although it is
|
||||||
|
# not required to, but it is helpful) 3) there are probably other weird
|
||||||
|
# implementations.
|
||||||
|
AC_LIBOBJ(getopt)
|
||||||
|
|
||||||
# Look for libevent.
|
# Look for libevent.
|
||||||
PKG_CHECK_MODULES(
|
PKG_CHECK_MODULES(
|
||||||
LIBEVENT,
|
LIBEVENT,
|
||||||
@@ -424,40 +430,6 @@ else
|
|||||||
AC_LIBOBJ(unvis)
|
AC_LIBOBJ(unvis)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Look for getopt. glibc's getopt does not enforce argument order and the ways
|
|
||||||
# of making it do so are stupid, so just use our own instead.
|
|
||||||
AC_CHECK_FUNC(getopt, found_getopt=yes, found_getopt=no)
|
|
||||||
if test "x$found_getopt" != xno; then
|
|
||||||
AC_MSG_CHECKING(if getopt is suitable)
|
|
||||||
AC_EGREP_CPP(
|
|
||||||
yes,
|
|
||||||
[
|
|
||||||
#include <features.h>
|
|
||||||
#ifdef __GLIBC__
|
|
||||||
yes
|
|
||||||
#endif
|
|
||||||
],
|
|
||||||
[
|
|
||||||
found_getopt=no
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
],
|
|
||||||
AC_MSG_RESULT(yes))
|
|
||||||
fi
|
|
||||||
if test "x$found_getopt" != xno; then
|
|
||||||
AC_CHECK_DECLS(
|
|
||||||
[optarg, optind, optreset],
|
|
||||||
,
|
|
||||||
found_getopt=no,
|
|
||||||
[
|
|
||||||
#include <unistd.h>
|
|
||||||
])
|
|
||||||
fi
|
|
||||||
if test "x$found_getopt" != xno; then
|
|
||||||
AC_DEFINE(HAVE_GETOPT)
|
|
||||||
else
|
|
||||||
AC_LIBOBJ(getopt)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Look for fdforkpty and forkpty in libutil.
|
# Look for fdforkpty and forkpty in libutil.
|
||||||
AC_SEARCH_LIBS(fdforkpty, util, found_fdforkpty=yes, found_fdforkpty=no)
|
AC_SEARCH_LIBS(fdforkpty, util, found_fdforkpty=yes, found_fdforkpty=no)
|
||||||
if test "x$found_fdforkpty" = xyes; then
|
if test "x$found_fdforkpty" = xyes; then
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ control_notify_input(struct client *c, struct window_pane *wp,
|
|||||||
else
|
else
|
||||||
evbuffer_add_printf(message, "%c", buf[i]);
|
evbuffer_add_printf(message, "%c", buf[i]);
|
||||||
}
|
}
|
||||||
|
evbuffer_add(message, "", 1);
|
||||||
control_write(c, "%s", EVBUFFER_DATA(message));
|
control_write(c, "%s", EVBUFFER_DATA(message));
|
||||||
evbuffer_free(message);
|
evbuffer_free(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ format_draw_put_list(struct screen_write_ctx *octx,
|
|||||||
width -= list_left->cx;
|
width -= list_left->cx;
|
||||||
}
|
}
|
||||||
if (start + width < list->cx && width > list_right->cx) {
|
if (start + width < list->cx && width > list_right->cx) {
|
||||||
screen_write_cursormove(octx, ocx + offset + width - 1, ocy, 0);
|
screen_write_cursormove(octx, ocx + offset + width -
|
||||||
|
list_right->cx, ocy, 0);
|
||||||
screen_write_fast_copy(octx, list_right, 0, 0, list_right->cx,
|
screen_write_fast_copy(octx, list_right, 0, 0, list_right->cx,
|
||||||
1);
|
1);
|
||||||
width -= list_right->cx;
|
width -= list_right->cx;
|
||||||
|
|||||||
42
format.c
42
format.c
@@ -895,6 +895,44 @@ format_cb_pane_in_mode(struct format_tree *ft, struct format_entry *fe)
|
|||||||
xasprintf(&fe->value, "%u", n);
|
xasprintf(&fe->value, "%u", n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Callback for pane_at_top. */
|
||||||
|
static void
|
||||||
|
format_cb_pane_at_top(struct format_tree *ft, struct format_entry *fe)
|
||||||
|
{
|
||||||
|
struct window_pane *wp = ft->wp;
|
||||||
|
struct window *w = wp->window;
|
||||||
|
int status, flag;
|
||||||
|
|
||||||
|
if (wp == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
status = options_get_number(w->options, "pane-border-status");
|
||||||
|
if (status == PANE_STATUS_TOP)
|
||||||
|
flag = (wp->yoff == 1);
|
||||||
|
else
|
||||||
|
flag = (wp->yoff == 0);
|
||||||
|
xasprintf(&fe->value, "%d", flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Callback for pane_at_bottom. */
|
||||||
|
static void
|
||||||
|
format_cb_pane_at_bottom(struct format_tree *ft, struct format_entry *fe)
|
||||||
|
{
|
||||||
|
struct window_pane *wp = ft->wp;
|
||||||
|
struct window *w = wp->window;
|
||||||
|
int status, flag;
|
||||||
|
|
||||||
|
if (wp == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
status = options_get_number(w->options, "pane-border-status");
|
||||||
|
if (status == PANE_STATUS_BOTTOM)
|
||||||
|
flag = (wp->yoff + wp->sy == w->sy - 1);
|
||||||
|
else
|
||||||
|
flag = (wp->yoff + wp->sy == w->sy);
|
||||||
|
xasprintf(&fe->value, "%d", flag);
|
||||||
|
}
|
||||||
|
|
||||||
/* Callback for cursor_character. */
|
/* Callback for cursor_character. */
|
||||||
static void
|
static void
|
||||||
format_cb_cursor_character(struct format_tree *ft, struct format_entry *fe)
|
format_cb_cursor_character(struct format_tree *ft, struct format_entry *fe)
|
||||||
@@ -2546,9 +2584,9 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
|
|||||||
format_add(ft, "pane_right", "%u", wp->xoff + wp->sx - 1);
|
format_add(ft, "pane_right", "%u", wp->xoff + wp->sx - 1);
|
||||||
format_add(ft, "pane_bottom", "%u", wp->yoff + wp->sy - 1);
|
format_add(ft, "pane_bottom", "%u", wp->yoff + wp->sy - 1);
|
||||||
format_add(ft, "pane_at_left", "%d", wp->xoff == 0);
|
format_add(ft, "pane_at_left", "%d", wp->xoff == 0);
|
||||||
format_add(ft, "pane_at_top", "%d", wp->yoff == 0);
|
format_add_cb(ft, "pane_at_top", format_cb_pane_at_top);
|
||||||
format_add(ft, "pane_at_right", "%d", wp->xoff + wp->sx == w->sx);
|
format_add(ft, "pane_at_right", "%d", wp->xoff + wp->sx == w->sx);
|
||||||
format_add(ft, "pane_at_bottom", "%d", wp->yoff + wp->sy == w->sy);
|
format_add_cb(ft, "pane_at_bottom", format_cb_pane_at_bottom);
|
||||||
|
|
||||||
wme = TAILQ_FIRST(&wp->modes);
|
wme = TAILQ_FIRST(&wp->modes);
|
||||||
if (wme != NULL) {
|
if (wme != NULL) {
|
||||||
|
|||||||
2
input.c
2
input.c
@@ -2304,7 +2304,7 @@ input_exit_rename(struct input_ctx *ictx)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (ictx->input_len == 0) {
|
if (ictx->input_len == 0) {
|
||||||
oe = options_get(wp->window->options, "automatic-rename");
|
oe = options_get_only(wp->window->options, "automatic-rename");
|
||||||
if (oe != NULL)
|
if (oe != NULL)
|
||||||
options_remove(oe);
|
options_remove(oe);
|
||||||
return;
|
return;
|
||||||
|
|||||||
123
key-string.c
123
key-string.c
@@ -242,64 +242,24 @@ key_string_lookup_string(const char *string)
|
|||||||
const char *
|
const char *
|
||||||
key_string_lookup_key(key_code key)
|
key_string_lookup_key(key_code key)
|
||||||
{
|
{
|
||||||
static char out[32];
|
static char out[32];
|
||||||
char tmp[8];
|
char tmp[8];
|
||||||
u_int i;
|
const char *s;
|
||||||
struct utf8_data ud;
|
u_int i;
|
||||||
size_t off;
|
struct utf8_data ud;
|
||||||
|
size_t off;
|
||||||
|
|
||||||
*out = '\0';
|
*out = '\0';
|
||||||
|
|
||||||
/* Handle no key. */
|
|
||||||
if (key == KEYC_NONE)
|
|
||||||
return ("None");
|
|
||||||
|
|
||||||
/* Handle special keys. */
|
|
||||||
if (key == KEYC_UNKNOWN)
|
|
||||||
return ("Unknown");
|
|
||||||
if (key == KEYC_ANY)
|
|
||||||
return ("Any");
|
|
||||||
if (key == KEYC_FOCUS_IN)
|
|
||||||
return ("FocusIn");
|
|
||||||
if (key == KEYC_FOCUS_OUT)
|
|
||||||
return ("FocusOut");
|
|
||||||
if (key == KEYC_PASTE_START)
|
|
||||||
return ("PasteStart");
|
|
||||||
if (key == KEYC_PASTE_END)
|
|
||||||
return ("PasteEnd");
|
|
||||||
if (key == KEYC_MOUSE)
|
|
||||||
return ("Mouse");
|
|
||||||
if (key == KEYC_DRAGGING)
|
|
||||||
return ("Dragging");
|
|
||||||
if (key == KEYC_MOUSEMOVE_PANE)
|
|
||||||
return ("MouseMovePane");
|
|
||||||
if (key == KEYC_MOUSEMOVE_STATUS)
|
|
||||||
return ("MouseMoveStatus");
|
|
||||||
if (key == KEYC_MOUSEMOVE_STATUS_LEFT)
|
|
||||||
return ("MouseMoveStatusLeft");
|
|
||||||
if (key == KEYC_MOUSEMOVE_STATUS_RIGHT)
|
|
||||||
return ("MouseMoveStatusRight");
|
|
||||||
if (key == KEYC_MOUSEMOVE_BORDER)
|
|
||||||
return ("MouseMoveBorder");
|
|
||||||
if (key >= KEYC_USER && key < KEYC_USER + KEYC_NUSER) {
|
|
||||||
snprintf(out, sizeof out, "User%u", (u_int)(key - KEYC_USER));
|
|
||||||
return (out);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Literal keys are themselves. */
|
/* Literal keys are themselves. */
|
||||||
if (key & KEYC_LITERAL) {
|
if (key & KEYC_LITERAL) {
|
||||||
snprintf(out, sizeof out, "%c", (int)(key & 0xff));
|
snprintf(out, sizeof out, "%c", (int)(key & 0xff));
|
||||||
return (out);
|
return (out);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Display C-@ as C-Space. */
|
||||||
* Special case: display C-@ as C-Space. Could do this below in
|
|
||||||
* the (key >= 0 && key <= 32), but this way we let it be found
|
|
||||||
* in key_string_table, for the unlikely chance that we might
|
|
||||||
* change its name.
|
|
||||||
*/
|
|
||||||
if ((key & KEYC_MASK_KEY) == 0)
|
if ((key & KEYC_MASK_KEY) == 0)
|
||||||
key = ' ' | KEYC_CTRL | (key & KEYC_MASK_MOD);
|
key = ' ' | KEYC_CTRL | (key & KEYC_MASK_MOD);
|
||||||
|
|
||||||
/* Fill in the modifiers. */
|
/* Fill in the modifiers. */
|
||||||
if (key & KEYC_CTRL)
|
if (key & KEYC_CTRL)
|
||||||
@@ -310,6 +270,69 @@ key_string_lookup_key(key_code key)
|
|||||||
strlcat(out, "S-", sizeof out);
|
strlcat(out, "S-", sizeof out);
|
||||||
key &= KEYC_MASK_KEY;
|
key &= KEYC_MASK_KEY;
|
||||||
|
|
||||||
|
/* Handle no key. */
|
||||||
|
if (key == KEYC_NONE)
|
||||||
|
return ("None");
|
||||||
|
|
||||||
|
/* Handle special keys. */
|
||||||
|
if (key == KEYC_UNKNOWN) {
|
||||||
|
s = "Unknown";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_ANY) {
|
||||||
|
s = "Any";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_FOCUS_IN) {
|
||||||
|
s = "FocusIn";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_FOCUS_OUT) {
|
||||||
|
s = "FocusOut";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_PASTE_START) {
|
||||||
|
s = "PasteStart";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_PASTE_END) {
|
||||||
|
s = "PasteEnd";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_MOUSE) {
|
||||||
|
s = "Mouse";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_DRAGGING) {
|
||||||
|
s = "Dragging";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_MOUSEMOVE_PANE) {
|
||||||
|
s = "MouseMovePane";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_MOUSEMOVE_STATUS) {
|
||||||
|
s = "MouseMoveStatus";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_MOUSEMOVE_STATUS_LEFT) {
|
||||||
|
s = "MouseMoveStatusLeft";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_MOUSEMOVE_STATUS_RIGHT) {
|
||||||
|
s = "MouseMoveStatusRight";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key == KEYC_MOUSEMOVE_BORDER) {
|
||||||
|
s = "MouseMoveBorder";
|
||||||
|
goto append;
|
||||||
|
}
|
||||||
|
if (key >= KEYC_USER && key < KEYC_USER + KEYC_NUSER) {
|
||||||
|
snprintf(tmp, sizeof tmp, "User%u", (u_int)(key - KEYC_USER));
|
||||||
|
strlcat(out, tmp, sizeof out);
|
||||||
|
return (out);
|
||||||
|
}
|
||||||
|
|
||||||
/* Try the key against the string table. */
|
/* Try the key against the string table. */
|
||||||
for (i = 0; i < nitems(key_string_table); i++) {
|
for (i = 0; i < nitems(key_string_table); i++) {
|
||||||
if (key == key_string_table[i].key)
|
if (key == key_string_table[i].key)
|
||||||
@@ -352,4 +375,8 @@ key_string_lookup_key(key_code key)
|
|||||||
|
|
||||||
strlcat(out, tmp, sizeof out);
|
strlcat(out, tmp, sizeof out);
|
||||||
return (out);
|
return (out);
|
||||||
|
|
||||||
|
append:
|
||||||
|
strlcat(out, s, sizeof out);
|
||||||
|
return (out);
|
||||||
}
|
}
|
||||||
|
|||||||
2
screen.c
2
screen.c
@@ -154,8 +154,6 @@ screen_set_cursor_colour(struct screen *s, const char *colour)
|
|||||||
int
|
int
|
||||||
screen_set_title(struct screen *s, const char *title)
|
screen_set_title(struct screen *s, const char *title)
|
||||||
{
|
{
|
||||||
char *cp;
|
|
||||||
|
|
||||||
if (!utf8_isvalid(title))
|
if (!utf8_isvalid(title))
|
||||||
return (0);
|
return (0);
|
||||||
free(s->title);
|
free(s->title);
|
||||||
|
|||||||
@@ -660,8 +660,7 @@ have_event:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c->tty.mouse_drag_flag = 0;
|
c->tty.mouse_drag_flag = 0;
|
||||||
|
goto out;
|
||||||
return (key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert to a key binding. */
|
/* Convert to a key binding. */
|
||||||
@@ -956,6 +955,7 @@ have_event:
|
|||||||
if (key == KEYC_UNKNOWN)
|
if (key == KEYC_UNKNOWN)
|
||||||
return (KEYC_UNKNOWN);
|
return (KEYC_UNKNOWN);
|
||||||
|
|
||||||
|
out:
|
||||||
/* Apply modifiers if any. */
|
/* Apply modifiers if any. */
|
||||||
if (b & MOUSE_MASK_META)
|
if (b & MOUSE_MASK_META)
|
||||||
key |= KEYC_ESCAPE;
|
key |= KEYC_ESCAPE;
|
||||||
@@ -964,6 +964,8 @@ have_event:
|
|||||||
if (b & MOUSE_MASK_SHIFT)
|
if (b & MOUSE_MASK_SHIFT)
|
||||||
key |= KEYC_SHIFT;
|
key |= KEYC_SHIFT;
|
||||||
|
|
||||||
|
if (log_get_level() != 0)
|
||||||
|
log_debug("mouse key is %s", key_string_lookup_key (key));
|
||||||
return (key);
|
return (key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,7 +1059,7 @@ server_client_key_callback(struct cmdq_item *item, void *data)
|
|||||||
* Mouse drag is in progress, so fire the callback (now that
|
* Mouse drag is in progress, so fire the callback (now that
|
||||||
* the mouse event is valid).
|
* the mouse event is valid).
|
||||||
*/
|
*/
|
||||||
if (key == KEYC_DRAGGING) {
|
if ((key & KEYC_MASK_KEY) == KEYC_DRAGGING) {
|
||||||
c->tty.mouse_drag_update(c, m);
|
c->tty.mouse_drag_update(c, m);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -1704,7 +1706,6 @@ static void
|
|||||||
server_client_dispatch(struct imsg *imsg, void *arg)
|
server_client_dispatch(struct imsg *imsg, void *arg)
|
||||||
{
|
{
|
||||||
struct client *c = arg;
|
struct client *c = arg;
|
||||||
const char *data;
|
|
||||||
ssize_t datalen;
|
ssize_t datalen;
|
||||||
struct session *s;
|
struct session *s;
|
||||||
|
|
||||||
@@ -1716,7 +1717,6 @@ server_client_dispatch(struct imsg *imsg, void *arg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = imsg->data;
|
|
||||||
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
|
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
|
||||||
|
|
||||||
switch (imsg->hdr.type) {
|
switch (imsg->hdr.type) {
|
||||||
|
|||||||
4
spawn.c
4
spawn.c
@@ -228,9 +228,9 @@ spawn_pane(struct spawn_context *sc, char **cause)
|
|||||||
* the pane's stored one unless specified.
|
* the pane's stored one unless specified.
|
||||||
*/
|
*/
|
||||||
if (sc->cwd != NULL)
|
if (sc->cwd != NULL)
|
||||||
cwd = format_single(item, sc->cwd, c, s, NULL, NULL);
|
cwd = format_single(item, sc->cwd, c, item->target.s, NULL, NULL);
|
||||||
else if (~sc->flags & SPAWN_RESPAWN)
|
else if (~sc->flags & SPAWN_RESPAWN)
|
||||||
cwd = xstrdup(server_client_get_cwd(c, s));
|
cwd = xstrdup(server_client_get_cwd(c, item->target.s));
|
||||||
else
|
else
|
||||||
cwd = NULL;
|
cwd = NULL;
|
||||||
|
|
||||||
|
|||||||
84
tmux.1
84
tmux.1
@@ -1036,9 +1036,12 @@ If
|
|||||||
is specified, list only clients connected to that session.
|
is specified, list only clients connected to that session.
|
||||||
.It Xo Ic list-commands
|
.It Xo Ic list-commands
|
||||||
.Op Fl F Ar format
|
.Op Fl F Ar format
|
||||||
|
.Op Ar command
|
||||||
.Xc
|
.Xc
|
||||||
.D1 (alias: Ic lscm )
|
.D1 (alias: Ic lscm )
|
||||||
List the syntax of all commands supported by
|
List the syntax of
|
||||||
|
.Ar command
|
||||||
|
or - if omitted - of all commands supported by
|
||||||
.Nm .
|
.Nm .
|
||||||
.It Ic list-sessions Op Fl F Ar format
|
.It Ic list-sessions Op Fl F Ar format
|
||||||
.D1 (alias: Ic ls )
|
.D1 (alias: Ic ls )
|
||||||
@@ -1503,9 +1506,11 @@ The following commands are supported in copy mode:
|
|||||||
.It Li "scroll-up" Ta "C-y" Ta "C-Up"
|
.It Li "scroll-up" Ta "C-y" Ta "C-Up"
|
||||||
.It Li "search-again" Ta "n" Ta "n"
|
.It Li "search-again" Ta "n" Ta "n"
|
||||||
.It Li "search-backward <for>" Ta "?" Ta ""
|
.It Li "search-backward <for>" Ta "?" Ta ""
|
||||||
.It Li "search-forward <for>" Ta "/" Ta ""
|
|
||||||
.It Li "search-backward-incremental <for>" Ta "" Ta "C-r"
|
.It Li "search-backward-incremental <for>" Ta "" Ta "C-r"
|
||||||
|
.It Li "search-backward-text <for>" Ta "" Ta ""
|
||||||
|
.It Li "search-forward <for>" Ta "/" Ta ""
|
||||||
.It Li "search-forward-incremental <for>" Ta "" Ta "C-s"
|
.It Li "search-forward-incremental <for>" Ta "" Ta "C-s"
|
||||||
|
.It Li "search-forward-text <for>" Ta "" Ta ""
|
||||||
.It Li "search-reverse" Ta "N" Ta "N"
|
.It Li "search-reverse" Ta "N" Ta "N"
|
||||||
.It Li "select-line" Ta "V" Ta ""
|
.It Li "select-line" Ta "V" Ta ""
|
||||||
.It Li "select-word" Ta "" Ta ""
|
.It Li "select-word" Ta "" Ta ""
|
||||||
@@ -1514,6 +1519,26 @@ The following commands are supported in copy mode:
|
|||||||
.It Li "top-line" Ta "H" Ta "M-R"
|
.It Li "top-line" Ta "H" Ta "M-R"
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
|
The search commands come in several varieties:
|
||||||
|
.Ql search-forward
|
||||||
|
and
|
||||||
|
.Ql search-backward
|
||||||
|
search for a regular expression;
|
||||||
|
the
|
||||||
|
.Ql -text
|
||||||
|
variants search for a plain text string rather than a regular expression;
|
||||||
|
.Ql -incremental
|
||||||
|
perform an incremental search and expect to be used with the
|
||||||
|
.Fl i
|
||||||
|
flag to the
|
||||||
|
.Ic command-prompt
|
||||||
|
command.
|
||||||
|
.Ql search-again
|
||||||
|
repeats the last search and
|
||||||
|
.Ql search-reverse
|
||||||
|
does the same but reverses the direction (forward becomes backward and backward
|
||||||
|
becomes forward).
|
||||||
|
.Pp
|
||||||
Copy commands may take an optional buffer prefix argument which is used
|
Copy commands may take an optional buffer prefix argument which is used
|
||||||
to generate the buffer name (the default is
|
to generate the buffer name (the default is
|
||||||
.Ql buffer
|
.Ql buffer
|
||||||
@@ -1565,7 +1590,7 @@ The synopsis for the
|
|||||||
command is:
|
command is:
|
||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
.It Xo Ic copy-mode
|
.It Xo Ic copy-mode
|
||||||
.Op Fl Meu
|
.Op Fl eHMqu
|
||||||
.Op Fl t Ar target-pane
|
.Op Fl t Ar target-pane
|
||||||
.Xc
|
.Xc
|
||||||
Enter copy mode.
|
Enter copy mode.
|
||||||
@@ -1575,6 +1600,11 @@ option scrolls one page up.
|
|||||||
.Fl M
|
.Fl M
|
||||||
begins a mouse drag (only valid if bound to a mouse key binding, see
|
begins a mouse drag (only valid if bound to a mouse key binding, see
|
||||||
.Sx MOUSE SUPPORT ) .
|
.Sx MOUSE SUPPORT ) .
|
||||||
|
.Fl H
|
||||||
|
hides the position indicator in the top right.
|
||||||
|
.Fl q
|
||||||
|
cancels copy mode and any other modes.
|
||||||
|
.Pp
|
||||||
.Fl e
|
.Fl e
|
||||||
specifies that scrolling to the bottom of the history (to the visible screen)
|
specifies that scrolling to the bottom of the history (to the visible screen)
|
||||||
should exit copy mode.
|
should exit copy mode.
|
||||||
@@ -2686,37 +2716,40 @@ To view the default bindings and possible commands, see the
|
|||||||
.Ic list-keys
|
.Ic list-keys
|
||||||
command.
|
command.
|
||||||
.It Xo Ic list-keys
|
.It Xo Ic list-keys
|
||||||
.Op Fl 1N
|
.Op Fl 1aN
|
||||||
.Op Fl P Ar prefix-string Fl T Ar key-table
|
.Op Fl P Ar prefix-string Fl T Ar key-table
|
||||||
.Op key
|
.Op Ar key
|
||||||
.Xc
|
.Xc
|
||||||
.D1 (alias: Ic lsk )
|
.D1 (alias: Ic lsk )
|
||||||
List all key bindings.
|
List key bindings.
|
||||||
By default this shows all keys or any bindings for
|
There are two forms: the default lists keys as
|
||||||
.Ar key
|
|
||||||
in the syntax of the
|
|
||||||
.Ic bind-key
|
.Ic bind-key
|
||||||
command.
|
commands;
|
||||||
.Fl N
|
.Fl N
|
||||||
instead show keys and attached notes, i
|
lists only keys with attached notes and shows only the key and note for each
|
||||||
.Ar key-table
|
key.
|
||||||
if given or in the
|
.Pp
|
||||||
|
With the default form, all key tables are listed by default.
|
||||||
|
.Fl T
|
||||||
|
lists only keys in
|
||||||
|
.Ar key-table .
|
||||||
|
.Pp
|
||||||
|
With the
|
||||||
|
.Fl N
|
||||||
|
form, only keys in the
|
||||||
.Em root
|
.Em root
|
||||||
and
|
and
|
||||||
.Em prefix
|
.Em prefix
|
||||||
key tables by default.
|
key tables are listed by default;
|
||||||
.Fl P
|
|
||||||
specifies a prefix to print before each key.
|
|
||||||
With
|
|
||||||
.Fl 1
|
|
||||||
only the first matching key and note is shown.
|
|
||||||
.Pp
|
|
||||||
Without
|
|
||||||
.Fl N ,
|
|
||||||
.Fl T
|
.Fl T
|
||||||
prints only keys in
|
also lists only keys in
|
||||||
.Ar key-table ,
|
.Ar key-table .
|
||||||
otherwise all key tables are printed.
|
.Fl P
|
||||||
|
specifies a prefix to print before each key and
|
||||||
|
.Fl 1
|
||||||
|
lists only the first matching key.
|
||||||
|
.Fl a
|
||||||
|
lists the command for keys that do have a note rather than skipping them.
|
||||||
.It Xo Ic send-keys
|
.It Xo Ic send-keys
|
||||||
.Op Fl FHlMRX
|
.Op Fl FHlMRX
|
||||||
.Op Fl N Ar repeat-count
|
.Op Fl N Ar repeat-count
|
||||||
@@ -4348,6 +4381,7 @@ The following variables are available, where appropriate:
|
|||||||
.It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
|
.It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
|
||||||
.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
|
.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
|
||||||
.It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
|
.It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
|
||||||
|
.It Li "selection_active" Ta "" Ta "1 if selection started and changes with the cursor in copy mode"
|
||||||
.It Li "selection_end_x" Ta "" Ta "X position of the end of the selection"
|
.It Li "selection_end_x" Ta "" Ta "X position of the end of the selection"
|
||||||
.It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection"
|
.It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection"
|
||||||
.It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
|
.It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
|
||||||
|
|||||||
2
tmux.h
2
tmux.h
@@ -927,7 +927,9 @@ struct window_pane {
|
|||||||
TAILQ_HEAD (, window_mode_entry) modes;
|
TAILQ_HEAD (, window_mode_entry) modes;
|
||||||
struct event modetimer;
|
struct event modetimer;
|
||||||
time_t modelast;
|
time_t modelast;
|
||||||
|
|
||||||
char *searchstr;
|
char *searchstr;
|
||||||
|
int searchregex;
|
||||||
|
|
||||||
TAILQ_ENTRY(window_pane) entry;
|
TAILQ_ENTRY(window_pane) entry;
|
||||||
RB_ENTRY(window_pane) tree_entry;
|
RB_ENTRY(window_pane) tree_entry;
|
||||||
|
|||||||
12
tty.c
12
tty.c
@@ -330,8 +330,10 @@ tty_start_tty(struct tty *tty)
|
|||||||
log_debug("%s: using UTF-8 for ACS", c->name);
|
log_debug("%s: using UTF-8 for ACS", c->name);
|
||||||
|
|
||||||
tty_putcode(tty, TTYC_CNORM);
|
tty_putcode(tty, TTYC_CNORM);
|
||||||
if (tty_term_has(tty->term, TTYC_KMOUS))
|
if (tty_term_has(tty->term, TTYC_KMOUS)) {
|
||||||
tty_puts(tty, "\033[?1000l\033[?1002l\033[?1006l\033[?1005l");
|
tty_puts(tty, "\033[?1000l\033[?1002l\033[?1003l");
|
||||||
|
tty_puts(tty, "\033[?1006l\033[?1005l");
|
||||||
|
}
|
||||||
|
|
||||||
if (tty_term_flag(tty->term, TTYC_XT)) {
|
if (tty_term_flag(tty->term, TTYC_XT)) {
|
||||||
if (options_get_number(global_options, "focus-events")) {
|
if (options_get_number(global_options, "focus-events")) {
|
||||||
@@ -404,8 +406,10 @@ tty_stop_tty(struct tty *tty)
|
|||||||
tty_raw(tty, tty_term_string(tty->term, TTYC_CR));
|
tty_raw(tty, tty_term_string(tty->term, TTYC_CR));
|
||||||
|
|
||||||
tty_raw(tty, tty_term_string(tty->term, TTYC_CNORM));
|
tty_raw(tty, tty_term_string(tty->term, TTYC_CNORM));
|
||||||
if (tty_term_has(tty->term, TTYC_KMOUS))
|
if (tty_term_has(tty->term, TTYC_KMOUS)) {
|
||||||
tty_raw(tty, "\033[?1000l\033[?1002l\033[?1006l\033[?1005l");
|
tty_raw(tty, "\033[?1000l\033[?1002l\033[?1003l");
|
||||||
|
tty_raw(tty, "\033[?1006l\033[?1005l");
|
||||||
|
}
|
||||||
|
|
||||||
if (tty_term_flag(tty->term, TTYC_XT)) {
|
if (tty_term_flag(tty->term, TTYC_XT)) {
|
||||||
if (tty->flags & TTY_FOCUS) {
|
if (tty->flags & TTY_FOCUS) {
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ window_buffer_draw(__unused void *modedata, void *itemdata,
|
|||||||
struct paste_buffer *pb;
|
struct paste_buffer *pb;
|
||||||
const char *pdata, *start, *end;
|
const char *pdata, *start, *end;
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
size_t psize, len;
|
size_t psize;
|
||||||
u_int i, cx = ctx->s->cx, cy = ctx->s->cy;
|
u_int i, cx = ctx->s->cx, cy = ctx->s->cy;
|
||||||
|
|
||||||
pb = paste_get_name(item->name);
|
pb = paste_get_name(item->name);
|
||||||
@@ -222,7 +222,7 @@ window_buffer_draw(__unused void *modedata, void *itemdata,
|
|||||||
while (end != pdata + psize && *end != '\n')
|
while (end != pdata + psize && *end != '\n')
|
||||||
end++;
|
end++;
|
||||||
buf = xreallocarray(buf, 4, end - start + 1);
|
buf = xreallocarray(buf, 4, end - start + 1);
|
||||||
len = utf8_strvis(buf, start, end - start, VIS_OCTAL|VIS_TAB);
|
utf8_strvis(buf, start, end - start, VIS_OCTAL|VIS_TAB);
|
||||||
if (*buf != '\0') {
|
if (*buf != '\0') {
|
||||||
screen_write_cursormove(ctx, cx, cy + i, 0);
|
screen_write_cursormove(ctx, cx, cy + i, 0);
|
||||||
screen_write_nputs(ctx, sx, &grid_default_cell, "%s",
|
screen_write_nputs(ctx, sx, &grid_default_cell, "%s",
|
||||||
|
|||||||
871
window-copy.c
871
window-copy.c
File diff suppressed because it is too large
Load Diff
21
window.c
21
window.c
@@ -548,31 +548,38 @@ window_get_active_at(struct window *w, u_int x, u_int y)
|
|||||||
struct window_pane *
|
struct window_pane *
|
||||||
window_find_string(struct window *w, const char *s)
|
window_find_string(struct window *w, const char *s)
|
||||||
{
|
{
|
||||||
u_int x, y;
|
u_int x, y, top = 0, bottom = w->sy - 1;
|
||||||
|
int status;
|
||||||
|
|
||||||
x = w->sx / 2;
|
x = w->sx / 2;
|
||||||
y = w->sy / 2;
|
y = w->sy / 2;
|
||||||
|
|
||||||
|
status = options_get_number(w->options, "pane-border-status");
|
||||||
|
if (status == PANE_STATUS_TOP)
|
||||||
|
top++;
|
||||||
|
else if (status == PANE_STATUS_BOTTOM)
|
||||||
|
bottom--;
|
||||||
|
|
||||||
if (strcasecmp(s, "top") == 0)
|
if (strcasecmp(s, "top") == 0)
|
||||||
y = 0;
|
y = top;
|
||||||
else if (strcasecmp(s, "bottom") == 0)
|
else if (strcasecmp(s, "bottom") == 0)
|
||||||
y = w->sy - 1;
|
y = bottom;
|
||||||
else if (strcasecmp(s, "left") == 0)
|
else if (strcasecmp(s, "left") == 0)
|
||||||
x = 0;
|
x = 0;
|
||||||
else if (strcasecmp(s, "right") == 0)
|
else if (strcasecmp(s, "right") == 0)
|
||||||
x = w->sx - 1;
|
x = w->sx - 1;
|
||||||
else if (strcasecmp(s, "top-left") == 0) {
|
else if (strcasecmp(s, "top-left") == 0) {
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = top;
|
||||||
} else if (strcasecmp(s, "top-right") == 0) {
|
} else if (strcasecmp(s, "top-right") == 0) {
|
||||||
x = w->sx - 1;
|
x = w->sx - 1;
|
||||||
y = 0;
|
y = top;
|
||||||
} else if (strcasecmp(s, "bottom-left") == 0) {
|
} else if (strcasecmp(s, "bottom-left") == 0) {
|
||||||
x = 0;
|
x = 0;
|
||||||
y = w->sy - 1;
|
y = bottom;
|
||||||
} else if (strcasecmp(s, "bottom-right") == 0) {
|
} else if (strcasecmp(s, "bottom-right") == 0) {
|
||||||
x = w->sx - 1;
|
x = w->sx - 1;
|
||||||
y = w->sy - 1;
|
y = bottom;
|
||||||
} else
|
} else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user