Skip to content

Commit

Permalink
Fix: pty_linux lookpath error
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Jan 8, 2023
1 parent e795e4a commit 7403820
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
*.out
pty
pty.exe
mcsm.ico
pty.rc
pty.syso
# Dependency directories (remove the comment below to include it)
# vendor/
cache/
Expand Down
10 changes: 5 additions & 5 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ type console struct {

// start pty subroutine
func (c *console) Start(dir string, command []string) error {
cmd, err := c.buildCmd(command)
if err != nil {
return err
}
if dir, err = filepath.Abs(dir); err != nil {
if dir, err := filepath.Abs(dir); err != nil {
return err
} else if err := os.Chdir(dir); err != nil {
return err
}
cmd, err := c.buildCmd(command)
if err != nil {
return err
}
c.cmd = cmd
cmd.Dir = dir
cmd.Env = c.env
Expand Down

0 comments on commit 7403820

Please sign in to comment.