File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -52,17 +52,10 @@ func Start(shellPath string, env map[string]string) error {
52
52
53
53
defer func () { _ = term .Restore (int (os .Stdin .Fd ()), oldState ) }() // Best effort.
54
54
55
+ time .Sleep (1500 * time .Millisecond ) // Give the shell some time to start.
56
+
55
57
// Copy stdin to the pty and the pty to stdout.
56
58
// NOTE: The goroutine will keep reading until the next keystroke before returning.
57
- go func () {
58
- _ , _ = io .Copy (ptmx , os .Stdin )
59
- }()
60
- go func () {
61
- _ , _ = io .Copy (os .Stdout , ptmx )
62
- }()
63
-
64
- time .Sleep (500 * time .Millisecond ) // Give the shell some time to start.
65
-
66
59
shellName := filepath .Base (shellPath )
67
60
68
61
// Set environment variables
@@ -95,5 +88,13 @@ func Start(shellPath string, env map[string]string) error {
95
88
_ , _ = ptmx .Write ([]byte ("clear\n " ))
96
89
}
97
90
91
+ go func () {
92
+ _ , _ = io .Copy (ptmx , os .Stdin )
93
+ }()
94
+
95
+ go func () {
96
+ _ , _ = io .Copy (os .Stdout , ptmx )
97
+ }()
98
+
98
99
return c .Wait ()
99
100
}
You can’t perform that action at this time.
0 commit comments