summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master
diff options
context:
space:
mode:
authorLibravatar Thomas Rast <trast@student.ethz.ch>2011-05-17 17:19:08 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-05-17 20:44:17 -0700
commitb5cc003253c8e1b505d5a2fbbcecb1ffcb409758 (patch)
tree1433f9ee41fee1a42bce53842c941769792d2eee /t/t4013/diff.diff-tree_--cc_--patch-with-stat_master
parentUpdate draft release notes to 1.7.5.2 (diff)
downloadtgif-b5cc003253c8e1b505d5a2fbbcecb1ffcb409758.tar.xz
add -i: ignore terminal escape sequences
On the author's terminal, the up-arrow input sequence is ^[[A, and thus fat-fingering an up-arrow into 'git checkout -p' is quite dangerous: git-add--interactive.perl will ignore the ^[ and [ characters and happily treat A as "discard everything". As a band-aid fix, use Term::Cap to get all terminal capabilities. Then use the heuristic that any capability value that starts with ^[ (i.e., \e in perl) must be a key input sequence. Finally, given an input that starts with ^[, read more characters until we have read a full escape sequence, then return that to the caller. We use a timeout of 0.5 seconds on the subsequent reads to avoid getting stuck if the user actually input a lone ^[. Since none of the currently recognized keys start with ^[, the net result is that the sequence as a whole will be ignored and the help displayed. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff-tree_--cc_--patch-with-stat_master')
0 files changed, 0 insertions, 0 deletions