Open aka-tpayne opened 8 years ago
Hey, thanks for reporting. The "last" file looks ok.
I'm not sure what could be causing this.
Nope, only plugins I'm using is tmux-resurrect and tmux-continuum. I'm not currently setup to restore vim session
I tried testing this and still can't reproduce.
Based on what you said in the first post it seems tmux-resurrect sends additional characters to the pane after vim is started. That would explain why you end up in insert mode with "m" typed in.. but it's not clear why those characters are sent..
I also have issues with vim. Using the below attached last
file, the window which belongs to the wiki
session happens something like what the OP describes, where i get vim resurrected in insert mode (but without C-m). The other vim instance on code
session won't even start although panes are created correctly.
pane 0 0 :bash 1 :* 0 :/home/aleprovencio 1 bash :
pane code 0 :bash 0 :- 0 :/home/aleprovencio/src/django-royalnew0 bash :
pane code 0 :bash 0 :- 1 :/home/aleprovencio/src/django-royalnew1 bash :
pane code 1 :vim 1 :* 0 :/home/aleprovencio/src/django-royalnew1 vim :vim
pane main 0 :bash 1 :* 0 :/home/aleprovencio/.tmux/resurrect 1bash :
pane wiki 0 :vim 1 :* 0 :/home/aleprovencio/usr/wiki 1 vim :vim
window 0 0 1 :* b33e,191x51,0,0,1
window code 0 0 :- 9543,191x52,0,0[191x25,0,0,2,191x26,0,26,3]
window code 1 1 :* b321,95x52,0,0,4
window main 0 1 :* b322,95x52,0,0,5
window wiki 0 1 :* b743,191x52,0,0,6
state main
Just found out this is an issue with @continuum-boot
Just found out this is an issue with @continuum-boot
Any idea how it's related to it? Which platform are you running tmux: OSX, Linux?
This is tmux 2.1 on Arch.
It's something related to the current start command new-session -d
because starting tmux this way after a tmux kill-server
the mess is there with a full reboot not beeing necessary.
I have a shortcut set on my system that starts a terminal and issues a tmux new-session -A -s main
so thats the way I usually start tmux, even before using resurrect/continuum. It works gracefully with @continuum-restore 'on'
, but it does not with @continuum-boot
.
I've also tryied playing without success wih @continuum-systemd-start-cmd
, maybe you can give a me a hint on this.
@bruno- ,
I could manage to make @continuum-boot
to work, IF @continuum-restore
is NOT on, so this is a matter of choosing either one of the options to have them working. When both are 'on', tmux service will not start (output below), but if @continuum-restore
is 'off' I still have a chance to manually restore. I've seen issues alike on tmux-continuum like https://github.com/tmux-plugins/tmux-continuum/issues/23 and https://github.com/tmux-plugins/tmux-continuum/issues/1 , should I open a new one?
● tmux.service - tmux default session (detached)
Loaded: loaded (/home/aleprovencio/.config/systemd/user/tmux.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since qui 2016-08-25 11:41:22 BRT; 58s ago
Docs: man:tmux(1)
Process: 21681 ExecStop=/home/aleprovencio/.tmux/plugins/tmux-resurrect/scripts/save.sh (code=exited, status=1/FAILURE)
Process: 20914 ExecStart=/usr/bin/tmux new-session -d (code=exited, status=0/SUCCESS)
Main PID: 16194
ago 25 11:41:22 xps save.sh[21681]: no server running on /tmp/tmux-1000/default
ago 25 11:41:22 xps save.sh[21681]: no server running on /tmp/tmux-1000/default
ago 25 11:41:22 xps save.sh[21681]: no server running on /tmp/tmux-1000/default
ago 25 11:41:22 xps save.sh[21681]: no server running on /tmp/tmux-1000/default
ago 25 11:41:22 xps save.sh[21681]: no server running on /tmp/tmux-1000/default
ago 25 11:41:22 xps save.sh[21681]: no server running on /tmp/tmux-1000/default
ago 25 11:41:22 xps save.sh[21681]: no server running on /tmp/tmux-1000/default
ago 25 11:41:22 xps systemd[743]: tmux.service: Control process exited, code=exited status=1
ago 25 11:41:22 xps systemd[743]: tmux.service: Unit entered failed state.
ago 25 11:41:22 xps systemd[743]: tmux.service: Failed with result 'exit-code'.
I'm not sure if this i 100% related, but I had to put in a hack to fix my vim stuff. When Python runs, it seems the options shown via ps cause issues. Not sure if this a byproduct of how ps stores the command set? I noticed if I quote the set commands it work:
# Does not work, opens files with the options for set/cmd instead
$ vim --cmd set pythonthreehome=/apollo/env/envImprovement/python3.8 /home/deguzim/.tmux.conf
"pythonthreehome=/apollo/env/envImprovement/python3.8"
"pythonthreehome=/apollo/env/envImprovement/python3.8" E212: Can't open file for writing
Press ENTER or type command to continue
# What it needs to be:
vim --cmd "set pythonthreehome=/apollo/env/envImprovement/python3.8" /home/deguzim/.tmux.conf
Script
#!/bin/bash
# Description: Patches some output from `ps` that tmux resurrect
# Uses to restore what you are doing
old_file=$(readlink -f ${HOME}/.tmux/resurrect/last)
new_file="/tmp/tmux-resurrect-ps-swap.txt"
while IFS= read -r line; do
# Fix 1: Patch vim commands. The arguments to `--cmd` need to be quoted
# in order for them to work right.
if [[ "${line}" =~ "vim" ]]; then
old_text=$(echo $line | awk -F'vim :' '{print $2}')
new_text=$(echo "${old_text}" | awk '{print $1" "$2" \""$3" "$4"\" "$5}')
line=$(echo "${line}" | sed "s|$old_text|$new_text|g")
fi
echo ${line}
done < "${old_file}" > "${new_file}"
# Replace file
mv "${new_file}" "${old_file}"
I use TPM to load tmux-resurrect, so I patch it after install with:
echo "$HOME/src/DeGuzim-Config/configuration/scripts/tmux-resurrect-ps.sh" >> ~/.tmux/plugins/tmux-resurrect/scripts/save.sh
It seems to say after "
Anyway, shouldn't tmux-resurrect be capturing /proc/$pid/cmdline
instead of ps
output???
Going to use https://github.com/tmux-python/tmuxp/ for now, even though it lacks full command + args restore.
When my panes are being restored and should open vim, every single time I end up in Insert mode with "m" on the first line and the cursor below it on the next line.
Here is the contents of my "last" file.