From 29c903d3e20511d2ba9029c7ebe5f4ba875ba939 Mon Sep 17 00:00:00 2001 From: tompng Date: Sat, 7 Sep 2024 02:41:18 +0900 Subject: [PATCH] Don't use bash and stty to spawn child process --- lib/yamatanooroti/vterm.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/yamatanooroti/vterm.rb b/lib/yamatanooroti/vterm.rb index c49b12b..7c29fe2 100644 --- a/lib/yamatanooroti/vterm.rb +++ b/lib/yamatanooroti/vterm.rb @@ -10,7 +10,8 @@ def start_terminal(height, width, command, wait: 0.01, timeout: 2, startup_messa @wait = wait @result = nil - @pty_output, @pty_input, @pid = PTY.spawn('bash', '-c', %[stty rows #{height.to_s} cols #{width.to_s}; "$@"], '--', *command) + @pty_output, @pty_input, @pid = PTY.spawn(*command) + @pty_output.winsize = [height, width] @vterm = VTerm.new(height, width) @vterm.set_utf8(true)