mirror of
https://github.com/tmux/tmux.git
synced 2025-04-05 07:38:49 +00:00
parent
557c2d7b25
commit
b01062ec14
@ -285,6 +285,13 @@ const struct options_table_entry options_table[] = {
|
||||
.text = "Style of the cursor."
|
||||
},
|
||||
|
||||
{ .name = "default-client-command",
|
||||
.type = OPTIONS_TABLE_COMMAND,
|
||||
.scope = OPTIONS_TABLE_SERVER,
|
||||
.default_str = "new-session",
|
||||
.text = "Default command to run when tmux is run without a command."
|
||||
},
|
||||
|
||||
{ .name = "default-terminal",
|
||||
.type = OPTIONS_TABLE_STRING,
|
||||
.scope = OPTIONS_TABLE_SERVER,
|
||||
|
@ -3448,6 +3448,7 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
|
||||
struct cmd_parse_result *pr;
|
||||
struct args_value *values;
|
||||
struct cmdq_item *new_item;
|
||||
struct cmd_list *cmdlist;
|
||||
|
||||
if (c->flags & CLIENT_EXIT)
|
||||
return;
|
||||
@ -3468,33 +3469,33 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
|
||||
}
|
||||
|
||||
if (argc == 0) {
|
||||
argc = 1;
|
||||
argv = xcalloc(1, sizeof *argv);
|
||||
*argv = xstrdup("new-session");
|
||||
cmdlist = cmd_list_copy(options_get_command(global_options,
|
||||
"default-client-command"), 0, NULL);
|
||||
} else {
|
||||
values = args_from_vector(argc, argv);
|
||||
pr = cmd_parse_from_arguments(values, argc, NULL);
|
||||
switch (pr->status) {
|
||||
case CMD_PARSE_ERROR:
|
||||
cause = pr->error;
|
||||
goto error;
|
||||
case CMD_PARSE_SUCCESS:
|
||||
break;
|
||||
}
|
||||
args_free_values(values, argc);
|
||||
free(values);
|
||||
cmd_free_argv(argc, argv);
|
||||
cmdlist = pr->cmdlist;
|
||||
}
|
||||
|
||||
values = args_from_vector(argc, argv);
|
||||
pr = cmd_parse_from_arguments(values, argc, NULL);
|
||||
switch (pr->status) {
|
||||
case CMD_PARSE_ERROR:
|
||||
cause = pr->error;
|
||||
goto error;
|
||||
case CMD_PARSE_SUCCESS:
|
||||
break;
|
||||
}
|
||||
args_free_values(values, argc);
|
||||
free(values);
|
||||
cmd_free_argv(argc, argv);
|
||||
|
||||
if ((c->flags & CLIENT_READONLY) &&
|
||||
!cmd_list_all_have(pr->cmdlist, CMD_READONLY))
|
||||
!cmd_list_all_have(cmdlist, CMD_READONLY))
|
||||
new_item = cmdq_get_callback(server_client_read_only, NULL);
|
||||
else
|
||||
new_item = cmdq_get_command(pr->cmdlist, NULL);
|
||||
new_item = cmdq_get_command(cmdlist, NULL);
|
||||
cmdq_append(c, new_item);
|
||||
cmdq_append(c, cmdq_get_callback(server_client_command_done, NULL));
|
||||
|
||||
cmd_list_free(pr->cmdlist);
|
||||
cmd_list_free(cmdlist);
|
||||
return;
|
||||
|
||||
error:
|
||||
|
11
tmux.1
11
tmux.1
@ -254,9 +254,10 @@ was given) and off.
|
||||
This specifies one of a set of commands used to control
|
||||
.Nm ,
|
||||
as described in the following sections.
|
||||
If no commands are specified, the
|
||||
.Ic new-session
|
||||
command is assumed.
|
||||
If no commands are specified, the command in
|
||||
.Ic default-client-command
|
||||
is assumed, which defaults to
|
||||
.Ic new-session .
|
||||
.El
|
||||
.Sh DEFAULT KEY BINDINGS
|
||||
.Nm
|
||||
@ -4085,6 +4086,10 @@ where the number is a hexadecimal number.
|
||||
Give the command to pipe to if the
|
||||
.Ic copy-pipe
|
||||
copy mode command is used without arguments.
|
||||
.It Ic default-client-command Ar command
|
||||
Set the default command to run when tmux is called without a command.
|
||||
The default is
|
||||
.Ic new-session .
|
||||
.It Ic default-terminal Ar terminal
|
||||
Set the default terminal for new windows created in this session - the
|
||||
default value of the
|
||||
|
Loading…
Reference in New Issue
Block a user