ivaaaan / smug

Session manager and task runner for tmux. Start your development environment within one command.
MIT License
712 stars 29 forks source link

Cannot open manual window with latest smug version #104

Closed mikedfunk closed 2 years ago

mikedfunk commented 2 years ago

Describe the bug I have a config defined with two windows. One is configured as manual: true. I open a session with smug start myconfig. This opens the first window successfully with the configured panes and commands.

Then I smug start myconfig:test2 which is the manual one. It fails to open.

Smug config

session: 'MyConfig'
windows:
  - name: test1
    commands: [ls]
    panes:
      - commands: [ls]
  - name: test2
    manual: true
    commands: [ls]
    panes:
      - commands: [ls]

Expected behavior The test2 window should open successfully with the defined layout

Output of cat ~/.config/smug/smug.log

tmux has-session -t MyConfig:
tmux neww -Pd -t MyConfig: -c  -F #{window_id} -n test2
tmux send-keys -t @3 ls Enter
tmux split-window -Pd -t @3 -c  -F #{pane_id}
tmux select-layout -t @3 tiled
tmux send-keys -t @3.%6 ls Enter
tmux select-layout -t @3 even-horizontal
tmux kill-window -t MyConfig:smug_def
exit status 1 can't find window: smug_def

tmux kill-window -t MyConfig:test2

It seems smug_def window is not being created in this scenario, which is expected to exist.

Smug version

Smug - tmux session manager. Version 0.3.1

OS you're using MacOS Monterey 12.4

benyanke commented 2 years ago

I can validate this bug is also in place for me on Ubuntu 20.04.

mikedfunk commented 2 years ago

If anyone uses this feature all the time like I do, a temp fix is:

tmux neww -n smug_def && smug start {session_name:window_name}
ivaaaan commented 2 years ago

Thanks, I will take a look at this tomorrow.

ivaaaan commented 2 years ago

Sorry took a bit longer time to fix this. Found another bug along the way. Should be working fine now.