diff --git a/config/main.go b/config/main.go index 850c02b..415bf8e 100644 --- a/config/main.go +++ b/config/main.go @@ -23,20 +23,13 @@ type Window struct { } type Configuration struct { - SessionName string `yaml:"name"` - EditorCommand string `yaml:"editor"` - WorkingDir string `yaml:"root"` - Windows []Window `yaml:"windows"` - LastOpened time.Time - Attach bool `yaml:"attach"` - StartupWindow string `yaml:"startup_window"` - StartupPane int `yaml:"startup_pane"` - OnProjectStart string `yaml:"on_project_start"` - OnProjectFirstStart string `yaml:"on_project_first_start"` - OnProjectRestart string `yaml:"on_project_restart"` - OnProjectExit string `yaml:"on_project_exit"` - OnProjectStop string `yaml:"on_project_stop"` - SocketName string `yaml:"socket_name"` + SessionName string `yaml:"name"` + EditorCommand string `yaml:"editor"` + WorkingDir string `yaml:"root"` + Windows []Window `yaml:"windows"` + LastOpened time.Time + Attach bool `yaml:"attach"` + StartupWindow string `yaml:"startup_window"` } var configDir string diff --git a/controller/tmux.go b/controller/tmux.go index 0d1ec6f..79c68af 100644 --- a/controller/tmux.go +++ b/controller/tmux.go @@ -98,7 +98,12 @@ func CreateTmuxSession(config *projectconfig.Configuration) error { } // Select the initial window and switch to the session - selectWindowCmd := exec.Command("tmux", "select-window", "-t", sessionName+":1") + defaultWindow := sessionName + ":1" + if config.StartupWindow != "" { + defaultWindow = config.StartupWindow + } + + selectWindowCmd := exec.Command("tmux", "select-window", "-t", defaultWindow) if err := selectWindowCmd.Run(); err != nil { return err }