diff options
author | James Booth <boothj5@gmail.com> | 2013-08-29 21:41:10 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-08-29 21:41:10 +0100 |
commit | 4738a15c89998ca0cae5621be652bb401721cdd5 (patch) | |
tree | e3d19f961799d17f0ee13c6a3abcf651c987970f /src | |
parent | 659e449e1287b05d8f56860938b73190609d8982 (diff) | |
download | profani-tty-4738a15c89998ca0cae5621be652bb401721cdd5.tar.gz |
Added /win command to access unlimited windows
Diffstat (limited to 'src')
-rw-r--r-- | src/command/command.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c index bae6a7c3..ef00fae8 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -143,6 +143,7 @@ static gboolean _cmd_tiny(gchar **args, struct cmd_help_t help); static gboolean _cmd_titlebar(gchar **args, struct cmd_help_t help); static gboolean _cmd_vercheck(gchar **args, struct cmd_help_t help); static gboolean _cmd_who(gchar **args, struct cmd_help_t help); +static gboolean _cmd_win(gchar **args, struct cmd_help_t help); static gboolean _cmd_wins(gchar **args, struct cmd_help_t help); static gboolean _cmd_xa(gchar **args, struct cmd_help_t help); @@ -409,6 +410,14 @@ static struct cmd_t command_defs[] = "Example : /nick bob", NULL } } }, + { "/win", + _cmd_win, parse_args, 1, 1, NULL, + { "/win num", "View a window.", + { "/win num", + "------------------", + "Show the contents of a specific window in the main window area.", + NULL } } }, + { "/wins", _cmd_wins, parse_args, 0, 1, NULL, { "/wins [tidy|prune]", "List or tidy active windows.", @@ -1662,6 +1671,19 @@ _cmd_wins(gchar **args, struct cmd_help_t help) return TRUE; } +static gboolean +_cmd_win(gchar **args, struct cmd_help_t help) +{ + int num = atoi(args[0]); + if (ui_win_exists(num)) { + ui_switch_win(num); + } else { + cons_show("Window %d does not exist.", num); + } + + return TRUE; +} + static gint _compare_commands(Command *a, Command *b) { |