--- bsflite-0.82/bsf.c 2006-11-07 16:56:00.000000000 -0500 +++ bsflite-0.82.new/bsf.c 2007-08-29 11:25:52.950376184 -0400 @@ -46,6 +46,8 @@ time_t last_status_time = 0; time_t last_keystroke_time; +char tmp[64]; + /* PROTO */ void addtoinputbuf(char inchr) @@ -258,7 +260,20 @@ break; case '\t': if (!(inputbuf[0] == 'm' || inputbuf[0] == 'i' || inputbuf[0] == 'l' || inputbuf[0] == 'A' || inputbuf[0] == 'P' || inputbuf[0] == 'p')) - break; + /* If tab is pressed on an empty line and if a message was previously + * sent, insert 'm' followed by the last used sn followed by a space. + * + * This makes it much easier to carry on a conversation with someone who + * has a clumsy sn. + */ + if (conn->lastsn != NULL) { + sprintf(tmp, "m%s ", conn->lastsn); + printf(tmp); + fflush(stdout); + strcat(inputbuf, tmp); + } else { + break; + } else { int spaces = 0; int match = 0;