mirror of https://github.com/xrehpicx/pee.git
fix: fixed working dir setting for panes
This commit is contained in:
parent
cdeaed61f7
commit
6a4ac440b0
|
@ -76,6 +76,13 @@ func CreateTmuxSession(config *projectconfig.Configuration) error {
|
||||||
}
|
}
|
||||||
log.Debug("Ran command", "command", selectPaneCmd.String())
|
log.Debug("Ran command", "command", selectPaneCmd.String())
|
||||||
|
|
||||||
|
// Change the working directory
|
||||||
|
changeDirCmd := exec.Command("tmux", "send-keys", "-t", paneName, "cd "+config.WorkingDir, "Enter")
|
||||||
|
if err := changeDirCmd.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Debug("Ran command", "command", changeDirCmd.String())
|
||||||
|
|
||||||
// Send commands to the pane
|
// Send commands to the pane
|
||||||
sendCommandsCmd := exec.Command("tmux", "send-keys", "-t", paneName, strings.Join(pane.ShellCommand, " && "), "Enter")
|
sendCommandsCmd := exec.Command("tmux", "send-keys", "-t", paneName, strings.Join(pane.ShellCommand, " && "), "Enter")
|
||||||
if err := sendCommandsCmd.Run(); err != nil {
|
if err := sendCommandsCmd.Run(); err != nil {
|
||||||
|
@ -184,6 +191,13 @@ func createWindow(config *projectconfig.Configuration, sessionName string, index
|
||||||
}
|
}
|
||||||
log.Debug("Ran command", "command", selectPaneCmd.String())
|
log.Debug("Ran command", "command", selectPaneCmd.String())
|
||||||
|
|
||||||
|
// Change the working directory for the pane
|
||||||
|
changeDirCmd := exec.Command("tmux", "send-keys", "-t", paneName, "cd "+config.WorkingDir, "Enter")
|
||||||
|
if err := changeDirCmd.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Debug("Ran command", "command", changeDirCmd.String())
|
||||||
|
|
||||||
// Send commands to the pane
|
// Send commands to the pane
|
||||||
sendCommandsCmd := exec.Command("tmux", "send-keys", "-t", paneName, strings.Join(pane.ShellCommand, " && "), "Enter")
|
sendCommandsCmd := exec.Command("tmux", "send-keys", "-t", paneName, strings.Join(pane.ShellCommand, " && "), "Enter")
|
||||||
if err := sendCommandsCmd.Run(); err != nil {
|
if err := sendCommandsCmd.Run(); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue