mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-18 11:05:16 +00:00
Make sure 'become' process is given a proper tty device
This commit is contained in:
parent
86e4f4a841
commit
16b0aeda7d
@ -2961,6 +2961,14 @@ func (t *Terminal) Loop() {
|
||||
if t.history != nil {
|
||||
t.history.append(string(t.input))
|
||||
}
|
||||
/*
|
||||
FIXME: It is not at all clear why this is required.
|
||||
The following command will report 'not a tty', unless we open
|
||||
/dev/tty *twice* after closing the standard input for 'reload'
|
||||
in Reader.terminate().
|
||||
: | fzf --bind 'start:reload:ls' --bind 'enter:become:tty'
|
||||
*/
|
||||
tui.TtyIn()
|
||||
util.SetStdin(tui.TtyIn())
|
||||
syscall.Exec(shellPath, []string{shell, "-c", command}, os.Environ())
|
||||
}
|
||||
|
@ -2921,6 +2921,11 @@ class TestGoFZF < TestBase
|
||||
OUTPUT
|
||||
tmux.until { assert_block(expected, _1) }
|
||||
end
|
||||
|
||||
def test_become_tty
|
||||
tmux.send_keys "sleep 0.5 | #{FZF} --bind 'start:reload:ls' --bind 'load:become:tty'", :Enter
|
||||
tmux.until { |lines| assert_includes lines, '/dev/tty' }
|
||||
end
|
||||
end
|
||||
|
||||
module TestShell
|
||||
|
Loading…
Reference in New Issue
Block a user