connect stdin of external commands to the terminal

Without Stdin, commands read from /dev/null, so interactive programs
like 'sudo su -', vim or ssh got EOF right away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Florian WaltherandClaude Opus 5.5 committed 2026-10-03 19:10:30 +02:00
1 parent 2b8f06ea6d
commit 03e791cbcd
2 files changed
+37 -2

No files matched your search

+6 -2
View File
@@ -760,9 +760,13 @@ Features:
// Prepare the command to execute.
cmd := exec.Command(args[0], args[1:]...)
// Set the correct output device.
cmd.Stderr = os.Stderr
// Connect the command to the terminal. Without Stdin the command would
// read from /dev/null, so interactive programs (su, vim, ssh, ...) would
// get EOF right away. readline only reads from stdin while a line is
// being edited, so it does not steal input from the command.
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
// Execute the command return the error.
return cmd.Run()