Add Terminal Settings, a connect timer and Send Break

HyperTerminal's Terminal Settings for each terminal of the Windows app
([terminal], [remote_terminal]): Backspace (Ctrl+H, Del, or Ctrl+H Space
Ctrl+H), terminal or Windows keys, backscroll lines, font, cursor, the
Telnet terminal ID, and exit upon disconnecting.

The status bar shows the connect timer during a call. Send Break (Modem
menu, Ctrl+Break) sends a break on a COM port or as Telnet's IAC BRK.

Core: dmc_vt_set_scrollback and dmc_net_break, with tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRekyRUhR43KbmGNXK
This commit is contained in:
Claude committed 2026-11-20 22:55:35 +00:00
1 parent 4f7e90f598
commit 8d6316e7ce
18 files changed
+608 -18

No files matched your search

+11 -1
View File
@@ -27,7 +27,7 @@
enum {
IAC = 255, DONT = 254, DO = 253, WONT = 252, WILL = 251, SB = 250,
SE = 240,
SE = 240, BRK = 243,
O_BINARY = 0, O_ECHO = 1, O_SGA = 3, O_TTYPE = 24, O_NAWS = 31
};
@@ -336,6 +336,16 @@ DMC_API int dmc_net_output(dmc_net *n, char *buf, int max)
return buf_take(&n->out, buf, max);
}
DMC_API int dmc_net_break(dmc_net *n)
{
/* Telnet's BRK; rlogin has none */
if (n->proto != DMC_NET_TELNET)
return 0;
buf_addc(&n->out, (char)IAC);
buf_addc(&n->out, (char)BRK);
return 1;
}
DMC_API void dmc_net_resize(dmc_net *n, int cols, int rows)
{
if (cols == n->cols && rows == n->rows)
+24
View File
@@ -1603,6 +1603,30 @@ void dmc_vt_feed(dmc_vt *t, const char *data, int n)
t->changed = 1;
}
void dmc_vt_set_scrollback(dmc_vt *t, int lines)
{
struct vt_line **h;
int n, i, drop;
if (lines < 0)
lines = 0;
if (lines == t->hist_max)
return;
/* the newest lines kept, the oldest freed */
n = t->hist_n < lines ? t->hist_n : lines;
drop = t->hist_n - n;
for (i = 0; i < drop; i++)
line_free(hist_at(t, i));
h = xcalloc((size_t)(lines ? lines : 1), sizeof(*h));
for (i = 0; i < n; i++)
h[i] = hist_at(t, drop + i);
free(t->hist);
t->hist = h;
t->hist_max = lines;
t->hist_n = n;
t->hist_first = 0;
t->changed = 1;
}
void dmc_vt_set_ascii(dmc_vt *t, int flags)
{
t->ascii = flags;