From 070ad50ed8334018b6545312e24abf2bbf744209 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Tue, 31 Dec 2024 01:18:38 +0530 Subject: [PATCH] refactor: modify ShellExecutable.Start to adjust read timeout based on arguments - Added functionality to remove the first argument when "setLongerReadTimeout" is specified, allowing for a configurable read timeout of 5000ms. - Enhanced the method's flexibility in handling command-line arguments for improved usability. --- internal/shell_executable/shell_executable.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/shell_executable/shell_executable.go b/internal/shell_executable/shell_executable.go index 14c676e..b77fcd9 100644 --- a/internal/shell_executable/shell_executable.go +++ b/internal/shell_executable/shell_executable.go @@ -81,6 +81,7 @@ func (b *ShellExecutable) Start(args ...string) error { readTimeout := 2000 * time.Millisecond if len(args) > 0 && args[0] == "setLongerReadTimeout" { readTimeout = 5000 * time.Millisecond + args = args[1:] } b.ptyReader = condition_reader.NewConditionReader(io.TeeReader(b.pty, b.vt), readTimeout)