Skip to content
Myr

Make sure 'become' process is given a proper tty device

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 86e4f4a · Browse files · 2 files+13 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−0 removed

  • tests:+5 added−0 removed
  • other:+8 added−0 removed

2 files+13 added−0 removed

modified:src/terminal.go+8 added
2959 unmodified lines
2960 t.tui.Close()2961 if t.history != nil {2962 t.history.append(string(t.input))2963 }2964 /*2965 FIXME: It is not at all clear why this is required.2966 The following command will report 'not a tty', unless we open2967 /dev/tty *twice* after closing the standard input for 'reload'2968 in Reader.terminate().2969 : | fzf --bind 'start:reload:ls' --bind 'enter:become:tty'2970 */2971 tui.TtyIn()2972 util.SetStdin(tui.TtyIn())2973 syscall.Exec(shellPath, []string{shell, "-c", command}, os.Environ())2974 }2975 }
739 unmodified lines
modified:test/test_go.rb+5 added
2919 unmodified lines
2920 >2921 OUTPUT2922 tmux.until { assert_block(expected, _1) }2923 end29242925 def test_become_tty2926 tmux.send_keys "sleep 0.5 | #{FZF} --bind 'start:reload:ls' --bind 'load:become:tty'", :Enter2927 tmux.until { |lines| assert_includes lines, '/dev/tty' }2928 end2929end29302931module TestShell2932 def setup
481 unmodified lines