This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 7812e0d8b0 Restore terminal echo after process-docs.sh completes
7812e0d8b0 is described below
commit 7812e0d8b03cc96c5ca6b0ff5a2b0087c07d6882
Author: Stephen Mallette <[email protected]>
AuthorDate: Thu Jul 16 10:18:52 2026 -0400
Restore terminal echo after process-docs.sh completes
The console subprocesses put the shared tty into raw mode and don't always
restore it, leaving the invoking shell unable to echo typed characters.
Assisted-by: Claude Code:claude-opus-4-8
---
bin/process-docs.sh | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/bin/process-docs.sh b/bin/process-docs.sh
index 0a47a5ac2d..b4cebbbf76 100755
--- a/bin/process-docs.sh
+++ b/bin/process-docs.sh
@@ -55,12 +55,25 @@ done
GREMLIN_SERVER_PID=""
GEPHI_MOCK_PID=""
+# The console subprocesses spawned by the docs extension drive JLine, which
puts the shared
+# controlling terminal into raw mode (echo off) even though its own
stdin/stdout are pipes. A
+# console that is killed rather than shut down cleanly never restores those
settings, leaving
+# the invoking shell unable to echo typed characters. Snapshot the settings
here and restore
+# them on exit.
+STTY_SAVED=""
+if [ -t 0 ]; then
+ STTY_SAVED=$(stty -g 2>/dev/null || true)
+fi
+
cleanup() {
set +e
[ -n "${GREMLIN_SERVER_PID}" ] && kill "${GREMLIN_SERVER_PID}" 2>/dev/null
[ -n "${GEPHI_MOCK_PID}" ] && kill "${GEPHI_MOCK_PID}" 2>/dev/null
+ [ -n "${STTY_SAVED}" ] && stty "${STTY_SAVED}" 2>/dev/null
}
trap cleanup EXIT
+trap 'cleanup; exit 130' INT
+trap 'cleanup; exit 143' TERM
# ---------------------------------------------------------------------------
# Dry-run mode