Improve /WINDOW DESCRIBE output

Instead of showing a meaningless pointer value for Screen:, we show the
screen number and ttyname.

Also take the CO, LI values from the window's screen.

Don't show the Prompt: unless one is set.
This commit is contained in:
Kevin Easton
2016-03-16 23:50:38 +11:00
parent 9427b3db84
commit f21b89e428
3 changed files with 34 additions and 41 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2.2] [Changes 1.2.2]
* Improve /WINDOW DESCRIBE output a little. (caf)
* If we can't create a socket for the first address returned by getaddrinfo(), * If we can't create a socket for the first address returned by getaddrinfo(),
try the other returned addresses. (caf) try the other returned addresses. (caf)

View File

@@ -1531,10 +1531,15 @@ Screen * BX_create_new_screen(void)
if (!main_screen) if (!main_screen)
#ifdef GUI #ifdef GUI
gui_screen(new); gui_screen(new);
malloc_strcpy(&new->tty_name, "<GUI>");
gui_resize(new); gui_resize(new);
#else #else
{
extern char attach_ttyname[];
main_screen = new; main_screen = new;
malloc_strcpy(&new->tty_name, attach_ttyname);
}
#endif #endif
init_input(); init_input();
return new; return new;
@@ -1733,8 +1738,9 @@ extern Window *BX_create_additional_screen (void)
kill(child, SIGKILL); kill(child, SIGKILL);
return NULL; return NULL;
} }
else
malloc_strcpy(&new->tty_name, buffer); chop(buffer, 1);
malloc_strcpy(&new->tty_name, buffer);
win = new_window(new); win = new_window(new);
refresh_screen(0, NULL); refresh_screen(0, NULL);

View File

@@ -697,9 +697,7 @@ void BX_move_window(Window *window, int offset)
void BX_resize_window(int how, Window *window, int offset) void BX_resize_window(int how, Window *window, int offset)
{ {
Window *other; Window *other;
int after, int window_size, other_size;
window_size,
other_size;
if (!window) if (!window)
window = current_window; window = current_window;
@@ -717,7 +715,6 @@ void BX_resize_window(int how, Window *window, int offset)
how = RESIZE_REL; how = RESIZE_REL;
} }
after = 1;
other = window; other = window;
do do
@@ -725,10 +722,7 @@ void BX_resize_window(int how, Window *window, int offset)
if (other->next) if (other->next)
other = other->next; other = other->next;
else else
{
other = window->screen->window_list; other = window->screen->window_list;
after = 0;
}
if (other == window) if (other == window)
{ {
@@ -2981,40 +2975,36 @@ static Window *window_describe (Window *window, char **args, char *usage)
else else
say("Window %u", window->refnum); say("Window %u", window->refnum);
say("\tServer: [%d] %s", say("\tServer: [%d] %s", window->server, get_server_name(window->server));
window->server, if (window->screen)
window->server <= -1 ? {
get_server_name(window->server) : "<None>"); say("\tScreen: [%d] %s", window->screen->screennum,
say("\tScreen: %p", window->screen); window->screen->tty_name ? window->screen->tty_name : "");
say("\tCO, LI are [%d %d]", window->screen->co, window->screen->li);
}
else
say("\tScreen: <None>");
say("\tGeometry Info: [%d %d %d %d %d %d]", say("\tGeometry Info: [%d %d %d %d %d %d]",
window->top, window->bottom, window->top, window->bottom,
window->held_displayed, window->display_size, window->held_displayed, window->display_size,
window->cursor, window->distance_from_display); window->cursor, window->distance_from_display);
#ifndef GUI
say("\tCO, LI are [%d %d]", current_term->TI_cols, current_term->TI_lines);
#else
say("\tCO, LI are [%d %d]", output_screen->co, output_screen->li);
#endif
say("\tCurrent channel: %s", say("\tCurrent channel: %s",
window->current_channel ? window->current_channel ?
window->current_channel : "<None>"); window->current_channel : "<None>");
if (window->waiting_channel)
if (window->waiting_channel) say("\tWaiting channel: %s", window->waiting_channel);
say("\tWaiting channel: %s", if (window->bind_channel)
window->waiting_channel); say("\tBound channel: %s", window->bind_channel);
if (window->bind_channel)
say("\tBound channel: %s",
window->bind_channel);
say("\tQuery User: %s %s", say("\tQuery User: %s %s",
window->query_nick ? window->query_nick ?
window->query_nick : "<None>", window->query_nick : "<None>",
window->query_cmd ? window->query_cmd ?
window->query_cmd : empty_string); window->query_cmd : empty_string);
say("\tPrompt: %s",
window->prompt ? if (window->prompt)
window->prompt : "<None>"); say("\tPrompt: %s", window->prompt);
say("\tSecond status line is %s", onoff[window->double_status]); say("\tSecond status line is %s", onoff[window->double_status]);
say("\tSplit line is %s triple is %s", onoff[window->status_split], onoff[window->status_lines]); say("\tSplit line is %s triple is %s", onoff[window->status_split], onoff[window->status_lines]);
say("\tLogging is %s", onoff[window->log]); say("\tLogging is %s", onoff[window->log]);
@@ -3024,16 +3014,11 @@ if (window->bind_channel)
else else
say("\tNo logfile given"); say("\tNo logfile given");
say("\tNotification is %s", say("\tNotification is %s", onoff[window->miscflags & WINDOW_NOTIFY]);
onoff[window->miscflags & WINDOW_NOTIFY]); say("\tHold mode is %s", onoff[window->hold_mode]);
say("\tHold mode is %s", say("\tWindow level is %s", bits_to_lastlog_level(window->window_level));
onoff[window->hold_mode]); say("\tLastlog level is %s", bits_to_lastlog_level(window->lastlog_level));
say("\tWindow level is %s", say("\tNotify level is %s", bits_to_lastlog_level(window->notify_level));
bits_to_lastlog_level(window->window_level));
say("\tLastlog level is %s",
bits_to_lastlog_level(window->lastlog_level));
say("\tNotify level is %s",
bits_to_lastlog_level(window->notify_level));
if (window->nicks) if (window->nicks)
{ {