summaryrefslogtreecommitdiffstats
path: root/scripts/git-hooks/commit-msg
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2025-11-29 20:36:14 +0000
committerPádraig Brady <P@draigBrady.com>2025-11-29 20:36:14 +0000
commit47b58df1bb5ad6c856d11cdd98aa3ce48d5e473f (patch)
tree1e4588b8c0be9d6cdaf4360de3d9db1ee6f00239 /scripts/git-hooks/commit-msg
parent68e39a581aed61bf11cf9a8a9a6468ef8caeb948 (diff)
downloadcoreutils-47b58df1bb5ad6c856d11cdd98aa3ce48d5e473f.tar.gz
coreutils-47b58df1bb5ad6c856d11cdd98aa3ce48d5e473f.zip
maint: commit-msg: fix terminal corruption when re-editing
* scripts/git-hooks/commit-msg: Explicitly connect the editor to /dev/tty, so that it can restore terminal settings appropriately.
Diffstat (limited to 'scripts/git-hooks/commit-msg')
-rwxr-xr-xscripts/git-hooks/commit-msg2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg
index bdea8c38d..05dce1ebb 100755
--- a/scripts/git-hooks/commit-msg
+++ b/scripts/git-hooks/commit-msg
@@ -49,7 +49,7 @@ sub re_edit($)
warn "Interrupt (Ctrl-C) to abort...\n";
- system 'sh', '-c', "$editor $log_file";
+ system 'sh', '-c', "$editor $log_file </dev/tty >/dev/tty 2>&1";
($? & 127) || ($? >> 8)
and die "$ME: $log_file: the editor ($editor) failed, aborting\n";
}