version 1.27, 2009/12/03 17:44:02 |
version 1.28, 2009/12/03 22:50:10 |
|
|
void cmd_set_option_string(struct cmd_ctx *, |
void cmd_set_option_string(struct cmd_ctx *, |
struct options *, const struct set_option_entry *, char *, int); |
struct options *, const struct set_option_entry *, char *, int); |
void cmd_set_option_number(struct cmd_ctx *, |
void cmd_set_option_number(struct cmd_ctx *, |
struct options *, const struct set_option_entry *, char *); |
struct options *, const struct set_option_entry *, char *); |
void cmd_set_option_keys(struct cmd_ctx *, |
void cmd_set_option_keys(struct cmd_ctx *, |
struct options *, const struct set_option_entry *, char *); |
struct options *, const struct set_option_entry *, char *); |
void cmd_set_option_colour(struct cmd_ctx *, |
void cmd_set_option_colour(struct cmd_ctx *, |
struct options *, const struct set_option_entry *, char *); |
struct options *, const struct set_option_entry *, char *); |
void cmd_set_option_attributes(struct cmd_ctx *, |
void cmd_set_option_attributes(struct cmd_ctx *, |
struct options *, const struct set_option_entry *, char *); |
struct options *, const struct set_option_entry *, char *); |
void cmd_set_option_flag(struct cmd_ctx *, |
void cmd_set_option_flag(struct cmd_ctx *, |
struct options *, const struct set_option_entry *, char *); |
struct options *, const struct set_option_entry *, char *); |
void cmd_set_option_choice(struct cmd_ctx *, |
void cmd_set_option_choice(struct cmd_ctx *, |
struct options *, const struct set_option_entry *, char *); |
struct options *, const struct set_option_entry *, char *); |
|
|
const struct cmd_entry cmd_set_option_entry = { |
const struct cmd_entry cmd_set_option_entry = { |
"set-option", "set", |
"set-option", "set", |
|
|
{ "status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-fg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-fg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-interval", SET_OPTION_NUMBER, 0, INT_MAX, NULL }, |
{ "status-interval", SET_OPTION_NUMBER, 0, INT_MAX, NULL }, |
{ "status-justify", |
{ "status-justify", |
SET_OPTION_CHOICE, 0, 0, set_option_status_justify_list }, |
SET_OPTION_CHOICE, 0, 0, set_option_status_justify_list }, |
{ "status-keys", SET_OPTION_CHOICE, 0, 0, set_option_status_keys_list }, |
{ "status-keys", SET_OPTION_CHOICE, 0, 0, set_option_status_keys_list }, |
{ "status-left", SET_OPTION_STRING, 0, 0, NULL }, |
{ "status-left", SET_OPTION_STRING, 0, 0, NULL }, |
|
|
{ "status-right-bg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-right-bg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-right-fg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-right-fg", SET_OPTION_COLOUR, 0, 0, NULL }, |
{ "status-right-length", SET_OPTION_NUMBER, 0, SHRT_MAX, NULL }, |
{ "status-right-length", SET_OPTION_NUMBER, 0, SHRT_MAX, NULL }, |
{ "status-utf8", SET_OPTION_FLAG, 0, 0, NULL }, |
{ "status-utf8", SET_OPTION_FLAG, 0, 0, NULL }, |
{ "terminal-overrides", SET_OPTION_STRING, 0, 0, NULL }, |
{ "terminal-overrides", SET_OPTION_STRING, 0, 0, NULL }, |
{ "update-environment", SET_OPTION_STRING, 0, 0, NULL }, |
{ "update-environment", SET_OPTION_STRING, 0, 0, NULL }, |
{ "visual-activity", SET_OPTION_FLAG, 0, 0, NULL }, |
{ "visual-activity", SET_OPTION_FLAG, 0, 0, NULL }, |
{ "visual-bell", SET_OPTION_FLAG, 0, 0, NULL }, |
{ "visual-bell", SET_OPTION_FLAG, 0, 0, NULL }, |
{ "visual-content", SET_OPTION_FLAG, 0, 0, NULL }, |
{ "visual-content", SET_OPTION_FLAG, 0, 0, NULL }, |
{ NULL, 0, 0, 0, NULL } |
{ NULL, 0, 0, 0, NULL } |
}; |
}; |
|
|
server_redraw_client(c); |
server_redraw_client(c); |
} |
} |
|
|
/* |
/* |
* Special-case: kill all persistent jobs if status-left, status-right |
* Special-case: kill all persistent jobs if status-left, status-right |
* or set-titles-string have changed. Persistent jobs are only used by |
* or set-titles-string have changed. Persistent jobs are only used by |
* the status line at the moment so this works XXX. |
* the status line at the moment so this works XXX. |
|
|
|
|
jobs = &c->status_jobs; |
jobs = &c->status_jobs; |
do { |
do { |
try_again = 0; |
try_again = 0; |
job = RB_ROOT(jobs); |
job = RB_ROOT(jobs); |
while (job != NULL) { |
while (job != NULL) { |
nextjob = RB_NEXT(jobs, jobs, job); |
nextjob = RB_NEXT(jobs, jobs, job); |
|
|
xasprintf(&newvalue, "%s%s", oldvalue, value); |
xasprintf(&newvalue, "%s%s", oldvalue, value); |
} else |
} else |
newvalue = value; |
newvalue = value; |
|
|
o = options_set_string(oo, entry->name, "%s", newvalue); |
o = options_set_string(oo, entry->name, "%s", newvalue); |
ctx->info(ctx, |
ctx->info(ctx, |
"set option: %s -> %s", o->name, cmd_set_option_print(entry, o)); |
"set option: %s -> %s", o->name, cmd_set_option_print(entry, o)); |