Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/commands/oscommands/cmd_obj_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (self *CmdObjBuilder) NewShell(commandStr string) ICmdObj {
}

func (self *CmdObjBuilder) NewInteractiveShell(commandStr string) ICmdObj {
quotedCommand := self.quotedCommandString(commandStr)
quotedCommand := self.quotedCommandString(commandStr + self.platform.InteractiveShellExit)
cmdArgs := str.ToArgv(fmt.Sprintf("%s %s %s %s", self.platform.InteractiveShell, self.platform.InteractiveShellArg, self.platform.ShellArg, quotedCommand))

return self.New(cmdArgs)
Expand Down
15 changes: 8 additions & 7 deletions pkg/commands/oscommands/dummies.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ func NewDummyCmdObjBuilder(runner ICmdObjRunner) *CmdObjBuilder {
}

var dummyPlatform = &Platform{
OS: "darwin",
Shell: "bash",
InteractiveShell: "bash",
ShellArg: "-c",
InteractiveShellArg: "-i",
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
OS: "darwin",
Shell: "bash",
InteractiveShell: "bash",
ShellArg: "-c",
InteractiveShellArg: "-i",
InteractiveShellExit: "; exit $?",
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
}

func NewDummyOSCommandWithRunner(runner *FakeCmdObjRunner) *OSCommand {
Expand Down
15 changes: 8 additions & 7 deletions pkg/commands/oscommands/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ type OSCommand struct {

// Platform stores the os state
type Platform struct {
OS string
Shell string
InteractiveShell string
ShellArg string
InteractiveShellArg string
OpenCommand string
OpenLinkCommand string
OS string
Shell string
InteractiveShell string
ShellArg string
InteractiveShellArg string
InteractiveShellExit string
OpenCommand string
OpenLinkCommand string
}

// NewOSCommand os command runner
Expand Down
15 changes: 8 additions & 7 deletions pkg/commands/oscommands/os_default_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (

func GetPlatform() *Platform {
return &Platform{
OS: runtime.GOOS,
Shell: "bash",
InteractiveShell: getUserShell(),
ShellArg: "-c",
InteractiveShellArg: "-i",
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
OS: runtime.GOOS,
Shell: "bash",
InteractiveShell: getUserShell(),
ShellArg: "-c",
InteractiveShellArg: "-i",
InteractiveShellExit: "; exit $?",
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
}
}

Expand Down
11 changes: 6 additions & 5 deletions pkg/commands/oscommands/os_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package oscommands

func GetPlatform() *Platform {
return &Platform{
OS: "windows",
Shell: "cmd",
InteractiveShell: "cmd",
ShellArg: "/c",
InteractiveShellArg: "",
OS: "windows",
Shell: "cmd",
InteractiveShell: "cmd",
ShellArg: "/c",
InteractiveShellArg: "",
InteractiveShellExit: "",
}
}
Loading