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. --- commands.txt | 18 ++++++++++++++---- editing_keys.txt | 27 ++++++++++++++++++++++----- src/irc.c | 24 ++++++++++++++++++++---- src/screen.c | 1 + 4 files changed, 57 insertions(+), 13 deletions(-) diff --git a/commands.txt b/commands.txt index fc97941..9641d6d 100644 --- a/commands.txt +++ b/commands.txt @@ -23,7 +23,9 @@ PRIVMSG to nick or channel. /q [] /query [] Creates a screen for PMs to/from if possible. If is -given, sends it to the . +given, sends it to the . can also be a channel, which +creates a channel screen for a channel that doesn't already have +its own screen. /quit [] Quits IRC with optional quit message. @@ -36,9 +38,13 @@ for the channel, it gets closed. /ping [] With no argument: ping the server. With arg: CTCP ping the nick. +The contents of RTCLOK are sent as the ping data, so when the +PONG response is received, the round-trip time can be shown, with +up to 1/60 (NTSC) or 1/50 (PAL) second accuracy. /me -CTCP ACTION. +CTCP ACTION. Only works in a channel or query screen (eventually +it'll work in [server] and [private] too) /ver CTCP VERSION. @@ -52,8 +58,12 @@ This command will be sent to the server as-is. The only reason it's a local command is so the argument can be required: sending LIST without any arguments lists every channel on the server, which isn't useful. -/color [] [] -Set colors. This should be on a per-window basis. +/color [] [] [] +Set colors. This should be on a per-screen basis, eventually. + +/chans +List all channels we've joined. This will actually be limited to +something like 20 (who joins more than 20 channels anyway?) /quote Send raw IRC protocol. diff --git a/editing_keys.txt b/editing_keys.txt index 4279605..4646c35 100644 --- a/editing_keys.txt +++ b/editing_keys.txt @@ -1,16 +1,33 @@ +This is kind of a weird mix of UNIX/Emacs/bash and traditional Atari. + ^A - move to start of buffer ^E - move to end of buffer ^U, Shift-Del - delete (clear) buffer +Shift-Clear or Ctrl-Clear: clear buffer and hide input box (show status) ^W - delete word to left of cursor Left/Right arrows - move cursor +Backspace - delete the character to the left of the cursor +Ctrl-Del - delete the character under the cursor -Future plans? +Future plans: -Up/Down arrows - history (if we can spare the RAM)... OR: +Start+S: hide (but do not clear) the input box; show status. The +input box will become visible again on the next keypress. +Shift + Ctrl + Up/Down arrows - history (if we can spare the RAM) Up/Down arrows - move up/down by one line (40 chars) -^Y, Shift-Insert - paste (^U and ^W fill a paste buffer) -Ctrl-Insert - toggle insert/typeover -Atari key - compose? we don't really have the font for it :( +^Y, Shift-Insert - paste (^K, ^U, ^W fill a paste buffer; need RAM) +Ctrl-Insert - toggle insert/typeover (does anyone care about this?) +Atari key - insert a ^B (meaning, toggle bold) ^U should be "delete to start of buffer", not delete whole line. ^K - kill (delete) to end of buffer. Ctrl + Shift + Left/Right - move back/forward one word (space-separated). +Tab - tab completion. For [server], complete channels. For [private], +complete nicks that have PM'ed us or that we have PM'ed. For channels, +complete channel nicks (we'll never have enough RAM to have full lists; +search back through screen memory is how it'll work) + +The glyphs for these will appear as inverse letters, but will actually +be the appropriate low ASCII characters: +^I - toggle italic +^L - toggle underline +^S - toggle strikethrough 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