From e45195d64362a2d8e3ea9206533b7b6c5b91bbaa Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sun, 1 Jan 2023 22:33:30 +0100 Subject: [PATCH 1/2] Add a "q" command to the terminal "q" used to be a unique abbrevation for "quit" before the introduction of the "quell" command, and it was an easy way to exit terminal mode. By adding it as an explicit command (must be before all longer commands starting with "q"), this functionality is regained. --- src/term.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/term.c b/src/term.c index c399c3e4..56bcae9d 100644 --- a/src/term.c +++ b/src/term.c @@ -85,6 +85,7 @@ static int cmd_quell (PROGRAMMER *pgm, AVRPART *p, int argc, char *argv[]); #define _fo(x) offsetof(PROGRAMMER, x) struct command cmd[] = { + { "q", cmd_quit, _fo(open), "abbreviation for 'quit'" }, { "dump", cmd_dump, _fo(read_byte_cached), "%s [ | ... | | ...]" }, { "read", cmd_dump, _fo(read_byte_cached), "alias for dump" }, { "write", cmd_write, _fo(write_byte_cached), "write [,] {[,]}" }, From b5cabc1dcf47ca8528e7ecf397bb13b43ac00ce3 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Mon, 2 Jan 2023 14:26:11 +0000 Subject: [PATCH 2/2] Move q command to end of list --- src/term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/term.c b/src/term.c index 56bcae9d..aaaf44fd 100644 --- a/src/term.c +++ b/src/term.c @@ -85,7 +85,6 @@ static int cmd_quell (PROGRAMMER *pgm, AVRPART *p, int argc, char *argv[]); #define _fo(x) offsetof(PROGRAMMER, x) struct command cmd[] = { - { "q", cmd_quit, _fo(open), "abbreviation for 'quit'" }, { "dump", cmd_dump, _fo(read_byte_cached), "%s [ | ... | | ...]" }, { "read", cmd_dump, _fo(read_byte_cached), "alias for dump" }, { "write", cmd_write, _fo(write_byte_cached), "write [,] {[,]}" }, @@ -108,7 +107,8 @@ struct command cmd[] = { { "quell", cmd_quell, _fo(open), "set quell level for progress bars" }, { "help", cmd_help, _fo(open), "show help message" }, { "?", cmd_help, _fo(open), "same as help" }, - { "quit", cmd_quit, _fo(open), "quit after writing out cache for flash & EEPROM" } + { "quit", cmd_quit, _fo(open), "quit after writing out cache for flash & EEPROM" }, + { "q", cmd_quit, _fo(open), "abbreviation for quit" }, }; #define NCMDS ((int)(sizeof(cmd)/sizeof(struct command)))