From ff02ca89a0b0bae712c6bbc1de6bc50be13010a8 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 7 Mar 2026 16:45:50 -0500 Subject: start + esc to close a screen, clear screen when closing. --- src/irc.c | 24 ++++++++++++++++++++---- src/screen.c | 1 + 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/irc.c b/src/irc.c index 0c1e4cd..6a66f24 100644 --- a/src/irc.c +++ b/src/irc.c @@ -400,15 +400,29 @@ static void parse_msg(void) { p = strtok(0, " "); if(p) { msg_args[msg_argcount] = p; + /* if any arg is a channel name, use it for the dest */ + if(*p == '#') + msg_dest = p; } else { break; } } } - if(msg_argcount) - msg_dest = msg_args[0]; - else if(msg_text) - msg_dest = msg_text; + + /* + if(msg_dest) { + scr_print_current("got here, msg_dest is: "); + scr_print_current(msg_dest); + scr_print_current("\n"); + } + */ + + if(!msg_dest) { + if(msg_argcount) + msg_dest = msg_args[0]; + else if(msg_text) + msg_dest = msg_text; + } if(msg_src) { if((p = strstr(msg_src, "!"))) { @@ -526,6 +540,8 @@ static void start_keystroke(void) { scr_display(s); } else if(i == CH_CURS_UP || i == '-') { scrollback(); + } else if(i == 0x1b) { /* escape */ + scr_destroy(scr_current); } } diff --git a/src/screen.c b/src/screen.c index e7f83b4..f442e66 100644 --- a/src/screen.c +++ b/src/screen.c @@ -91,6 +91,7 @@ void scr_destroy(char s) { scr_names[s][0] = 0; if(scr_current == s) scr_display(0); + scr_clear(s); } void scr_set_topic(char s, const char *topic) { -- cgit v1.2.3