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