Open devrrior opened 2 years ago
Same issue here. I'm suspicious that this issue may happens on MacOS only, because this issue does not happen on my Linux environment.
tmuxinator 3.0.2
tmux 3.2a
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
echo $OSTYPE
: darwin20.0
Config file:
# /Users/davimarcondesmoreira/.config/tmuxinator/my-dotfiles.yml
name: my-dotfiles
root: /Users/davimarcondesmoreira/Projects/Devdrops/etc/my-dotfiles
on_project_start: git fetch --all
startup_window: VIM
windows:
- VIM: vim .
- ENV:
layout: even-horizontal
panes:
- git status
- git status
- GIT:
layout: main-horizontal
panes:
- CURRENT_STATUS:
- git status -u
- FILES_AND_TIME:
- tmux split-window -t 2.1 -h
- tmux resize-pane -t 2.1 -R 40
- tmux clock-mode -t 2.2
- tmux send-keys -t 2.1 "git diff origin/main...`git rev-parse --abbrev-ref HEAD` --name-only --diff-filter=AM" Enter
Output from show-messages
:
11:13: /dev/ttys000 command: show-messages
11:13: /dev/ttys000 key :: command-prompt
11:13: /dev/ttys000 command: attach-session -t my-dotfiles
11:13: /dev/ttys000 command: select-pane -t my-dotfiles:VIM.0
11:13: /dev/ttys000 command: select-window -t my-dotfiles:VIM
11:13: /dev/ttys000 command: send-keys -t my-dotfiles:0 "vim ." C-m
11:13: /dev/ttys000 command: new-window -c /Users/davimarcondesmoreira/Projects/Devdrops/etc/my-dotfiles -n GIT -t my-dotfiles:2
11:13: /dev/ttys000 command: new-window -c /Users/davimarcondesmoreira/Projects/Devdrops/etc/my-dotfiles -n ENV -t my-dotfiles:1
11:13: /dev/ttys000 command: send-keys -t my-dotfiles:0 "cd /Users/davimarcondesmoreira/Projects/Devdrops/etc/my-dotfiles" C-m
11:13: /dev/ttys000 command: new-session -d -n VIM -s my-dotfiles
Same issue also reproducible on Linux running in WSL2. I am installing from apt
so in my case I have:
Same here. I was setting up a new machine and absolutely losing it because I couldn't figure out what was wrong with my yml.
same here
did anyone manage to fix this? same for me
If someone could give me the output of tmuxinator debug <project>
, it might help debugging this issue. 🙇
I am not able to reproduce it locally yet, but it seems similar to https://github.com/tmuxinator/tmuxinator/issues/909
@akofink
so for me the problem actually seems to be, that the keys are send before oh-my-posh is fully loaded. As such I assume the issue is not because of tmuxinator.
For good measure heres the output anyway:
#!/bin/zsh
# Clear rbenv variables before starting tmux
unset RBENV_VERSION
unset RBENV_DIR
tmux start-server;
cd /home/simon/1_Coding/todo-list
# Run on_project_start command.
# Run pre command.
# Run on_project_first_start command.
# Create the session and the first window. Manually switch to root
# directory if required to support tmux < 1.9
TMUX= tmux new-session -d -s todo-list -n editor -c /home/simon/1_Coding/todo-list
# Create other windows.
tmux new-window -c /home/simon/1_Coding/todo-list -t todo-list:2 -n bacon
# Window "editor"
tmux set-window-option -t todo-list:1 pane-border-status top
tmux set-window-option -t todo-list:1 pane-border-format "#{pane_index}: #{pane_title}"
tmux send-keys -t todo-list:1.1 nvim C-m
tmux splitw -c /home/simon/1_Coding/todo-list -t todo-list:1
tmux select-layout -t todo-list:1 tiled
tmux send-keys -t todo-list:1.2 cargo\ check C-m
tmux select-layout -t todo-list:1 tiled
tmux select-layout -t todo-list:1 main-vertical
tmux select-pane -t todo-list:1.1
# Window "bacon"
tmux set-window-option -t todo-list:2 pane-border-status top
tmux set-window-option -t todo-list:2 pane-border-format "#{pane_index}: #{pane_title}"
tmux send-keys -t todo-list:2 bacon\ clippy C-m
tmux select-window -t todo-list:1
tmux select-pane -t todo-list:1.1
if [ -z "$TMUX" ]; then
tmux -u attach-session -t todo-list
else
tmux -u switch-client -t todo-list
fi
# Run on_project_exit command.
That makes sense! Thank you for this insight, it is really useful. 💯
ofc!
For anyone who might come across this later on, a workaround that worked for me:
I use zsh-defer on the eval "$(oh-my-posh init zsh ...)"
command.
To avoid showing the default for a split second, I also set PS1=""
at the beginning of my .zshrc file.
# .zshrc
PS1=""
# [...]
zsh-defer eval "($oh-my-posh) init zsh --config [...]
@DefinitelyNotSimon13 ~I'm having this same issue on NixOS, neovim just doesn't open but it shows the command above oh-my-posh.~ I applied the above mentioned fix but it did not work.
Edit: I found out Nix wasn't adding the zsh-defer line properly and it is all working now thanks!
Here is my project:
name: nodenvim
root: /run/media/allusive/SSD/Projects/NodeProjects/
windows:
- editor:
layout: cf13,204x46,0,0{147x46,0,0[147x34,0,0,0,147x11,0,35,2],56x46,148,0,1}
# synchronize: after
panes:
- neovim:
- nvim
- #empty
- #empty
Describe the bug When I start one of my projects, the commands which I set to run in the panes don't run correctly.
To Reproduce Just run
tmuxinator start project
Expected behavior I expected my windows to execute the commands correctly.
Environment
Additional information
My config