You are not logged in.

#1 2017-06-06 10:24:59

tick1020
Member
Registered: 2017-04-22
Posts: 26

[Solved] Tmux and vim issues....

Alright so i have no idea what to make of whats going on with me. I'm having some really really strange reactions with tmux and vim. I've used them in combination before and never had problems.. This a pretty fresh install, im totally up to date tmux 2.5.1 and vim 8.0.

So basically tmux is causing major file loss for me randomly when i use it to edit with vim. 2 days ago i lost probably 5 hours worth of work and i was saving the whole time. Its like a few hours in "something" just stopped letting me save. Yesterday  i noticed how bad the lag was from the time i pressed esc to the time i exits insert mode in vim so i tried the ttimeoutlen line and when that didnt work i slowly took everything out of my vimrc until i had nothing but a few lines in it. Then i opened a new terminal window outside of tmux and BAM my vim was lag free. So i copied my vimrc back over and uncommented a few things and went back to the tmux term to continue trouble shooting it. I ended up deleting my tmux config and my vimrc, i have no plugins installed on either and i only had vimwiki on vim to begin with, the lag persists. But here comes the crazy part. I figured out that it was tmux causing the file loss, when i opened my vimrc that i had edited outside of tmux it still showed the file like 2 saves before i left tmux... It like it just vanished and no matter what i would do i couldnt get it to load the new file that's definitely there.

Restarting tmux and the problem persists with the lag. And im not really sure what to do about the file loss. Am i loosing my mind or is this something stupid and my lack of sleep is showing? Anyone know what i can check next? pluginless and blank rc vim and pluginless and blank rc tmux and i can totally reproduce breaking the filesystem by editing a file outside of tmux and trying to reopen in tmux. or vise versa. I can't find a single thing about tmux doing anything to the filesystem online and its not like i havent used it before, ive never had any problems with tmux or vim for that matter unless it was something stupid id done to the config files....

Last edited by tick1020 (2017-06-07 09:46:25)

Offline

#2 2017-06-06 12:47:17

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [Solved] Tmux and vim issues....

Oooh, that sounds like a nasty issue. sad In regards to losing your data, Tmux doesn't do anything but display, and Vim is decades old and stable... My guess, is that the massive lag was maybe causing your Vim "save" commands to be missed?

...anyway...

What terminal application are you using? GNOME Terminal? Rxvt? TTY?

Please try this test: Remove your "~/.tmuxrc" and "~/.vimrc" and "~/.Xdefaults" files (temporarily), start "xterm", and try tmux and vim again. Does it still have lag?

Offline

#3 2017-06-07 02:56:00

tick1020
Member
Registered: 2017-04-22
Posts: 26

Re: [Solved] Tmux and vim issues....

yeah, ive never heard of such a thing either but i as of now, if i work using a tmux session, open another terminal (without tmux) and edit a file if i go back to my tmux session and open that very same file, the changes i JUST made arent there. Literally. And the worst part of this is if i say it was something small or i just opened the file to look at it in another terminal every thing i save in the tmux session isn't actually saved from that point on. And it doesnt matter what terminal i use. It happens in xterm urxvt termite tilda konsole... removing the config files doesnt change a thing, i don't have a ~/.Xdefaults though. I've never messed with that file. I'm not sure what it is. I'm going to check the configs in /etc for tmux and vim and make sure they arent corrupted i suppose.

I never changed them myself but maybe they were corrupted in some way... But i would think that if that was the problem when my ~/ configs are there, don't they stop parsing the ones in /etc? im am totally lost on this. This is what i get for trying to use a actual DE this time around instead of just a window manager..

It doesnt seem to be a an issue of config files no matter what i do with them the problem persists, i really think i might have discovered some bug in one of these programs but i find it hard to believe it's either vim or tmux as you said ive been using both, well vim, for years now and never had a problem like this unless it was some crasy plugin, which isnt the case here... Im not sure what to think. But i really would like to find a way to make them work properly as thats kindof my whole workflow for the moment, im getting nothing done.... i might try one of the tmux splits on github or the aur and see if they fix the problem...

Last edited by tick1020 (2017-06-07 03:08:36)

Offline

#4 2017-06-07 06:57:32

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [Solved] Tmux and vim issues....

Sanity check: have you verified that you are actually editing the same file? In the same directory? Like, you're not running tmux as root or something (which would cause your shell to start in /root rather than in your home)? Please check with

pwd

As for the delay for escape: that's a tmux thing. Apparently it allows you to send escape sequences, although I never make use of that, so I removed the delay:

set -sg escape-time 0

pkgshackscfgblag

Offline

#5 2017-06-07 08:15:33

tick1020
Member
Registered: 2017-04-22
Posts: 26

Re: [Solved] Tmux and vim issues....

Yeah, I'm not crazy trust me i thought the same thing. i was in my home directory, it was my vimrc that i had edited and it wasnt even as though it wouldnt open my vimrc, it would it was just the last version of my vimrc i had edited in tmux... Its like im in my own branch in tmux. But when i leave nothing i save during the session is effect ONLY AFTER or if i open the same file outside of tmux. And I was able to recreate it again with a test document after closing everything and moving into a tmp directory... But i will check again and make sure im not crazy.

I appreciate the help with tmux that definitely did get rid of the delay. Ill Make another post in a few minutes after i re test these file issues.

Last edited by tick1020 (2017-06-07 08:19:44)

Offline

#6 2017-06-07 08:26:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Tmux and vim issues....

Please paste the output of `printenv` with tmux running.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2017-06-07 09:01:25

tick1020
Member
Registered: 2017-04-22
Posts: 26

Re: [Solved] Tmux and vim issues....

So I'm not 100% sure i can reproduce it now. I just tried again and everthing worked fine. Originally when i lost the large ammount of work even though i know i must have saved 100 times, and the second time also when i could recreate it with any file i wanted; both times i was using yakuake, the drop down terminal i think the kde guys made. That was where the original bugged sessions started but i had moved the session to different terminals afterwards and it continued. for some reason at the time i was thinking that covered it and it had to be tmux somehow, I was exhausted and really upset about loosing my work... There was definitely some kind of bug at work then but since i can't reproduce it now and my other issue is solved unless my environment gives some revelation... I'm not sure what to do. I'm going to continue to try and reproduce it using that yakuake terminal ill let you know what happens in the meantime here is my environment inside tmux from termite i think...

BROWSER=firefox
BROWSERCLI=w3m
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DE=kde
DESKTOP_SESSION=plasma
DISPLAY=:0
EDITOR=vim
GDMSESSION=plasma
GDM_LANG=en_US.utf8
GS_LIB=/home/aaron/.fonts
GTK2_RC_FILES=/home/aaron/.gtkrc-2.0
GTK_MODULES=canberra-gtk-module
HOME=/home/aaron
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=5
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_ALL=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LESS=-R
LOGNAME=aaron
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
MAIL=/var/spool/mail/aaron
MAVEN_OPTS=-Xmx512m
MOVPLAY=mpv
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
OLDPWD=/home/aaron
PAGER=less
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/aaron/bin
PICVIEW=feh
PWD=/home/aaron
QSG_RENDER_LOOP=
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_QUICK_CONTROLS_STYLE=org.kde.desktop
SESSION_MANAGER=local/arch-xidax:@/tmp/.ICE-unix/756,unix/arch-xidax:/tmp/.ICE-unix/756
SHELL=/bin/zsh
SHLVL=3
SNDPLAY=mpv
TERM=xterm-256color
TERMINAL=konsole
TMUX=/tmp/tmux-1000/default,5618,0
TMUX_PANE=%0
USER=aaron
WINDOWID=69206030
XAUTHORITY=/home/aaron/.Xauthority
XCURSOR_THEME=breeze_cursors
XDG_CURRENT_DESKTOP=KDE
XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/aaron
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_DESKTOP=plasma
XDG_SESSION_ID=c2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7
XTERM_LOCALE=en_US.UTF-8
XTERM_SHELL=/bin/zsh
XTERM_VERSION=XTerm(328)
ZSH=/home/aaron/.config/oh-my-zsh
_=/usr/bin/printenv

Offline

#8 2017-06-07 09:03:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Tmux and vim issues....

OhMyZsh. Makes sense...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2017-06-07 09:10:22

tick1020
Member
Registered: 2017-04-22
Posts: 26

Re: [Solved] Tmux and vim issues....

Yeah, those scripts can definitely cause some headaches, you think they could have caused this? Cause i definitely don't need all that crap. theres a like 3 plugins i use and i could implement them separate from OMZ now that i've figured out how they work... I haven't messed much with that main oh-my-zsh script, its a huge file and it doesnt seem like it does much that i actually use to me... just gives people to a way to implement the scripts it comes with i guess and the options it adds to rc file i guess thats what that script does. I could probably take out the parts i want it any and just put them in my zshrc and get rid of the rest.

Offline

#10 2017-06-07 09:13:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Tmux and vim issues....

There are two things OMZ is exceptionally good at: a) taking a wonderful shell and turning it into a bloated clusterfuck and, b) generating support threads for people with "unexplained irregularities".

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB