From 79db97834952a8d9887925b445924eb42f790207 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Sun, 17 Dec 2023 17:40:27 +1000 Subject: [PATCH] fix bug with ctrl+d leaving the tty in an unknown state --- clite/core.js | 5 +++++ clite/shell.js | 1 + clite/user.js | 2 ++ 3 files changed, 8 insertions(+) diff --git a/clite/core.js b/clite/core.js index 300f8c6..7b1c0ec 100644 --- a/clite/core.js +++ b/clite/core.js @@ -2815,6 +2815,11 @@ clite.tty = { case 'rows': return t.data.length; break; + case 'sane': + t.raw = false; + t.echo = true; + return true; + break; default: return false; } diff --git a/clite/shell.js b/clite/shell.js index 63de40f..ba2c58f 100644 --- a/clite/shell.js +++ b/clite/shell.js @@ -982,6 +982,7 @@ Options: switch (str) { case String.fromCharCode(4): case 4: + term.ttyctrl('raw',false); doShellExit(0); break; case '\t': // tab diff --git a/clite/user.js b/clite/user.js index 6dbe6e0..c32c01b 100644 --- a/clite/user.js +++ b/clite/user.js @@ -549,6 +549,8 @@ Options: return 1; } + term.ttyctrl('sane'); + if (user != null) { setUser(user); return null;