mini.vim with the following contents (I tried both gruvbox and solarized and observed the same behavior):set nocompatible
set runtimepath^=/home/user/.vim/plugged/gruvbox
colorscheme gruvbox
set background=dark
set number
vim -u mini.vim README.mdThe expected behavior is for the visual selection to only select the lines without making any changes to the position of the characters
9.0.1435
Operating system: Ubuntu 22.04 accessed through SSH (mosh) via macOS Ventura 13.5.2
Terminal: iTerm 2
Value of $TERM: screen-256color
Shell: zsh
This issue only occurs when inside a tmux session.
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
can you please verify with the lastest Vim version?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Does it issue happen if $TERM is set to tmux-256color?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
can you please verify with the lastest Vim version?
I face the same issue in the latest version of Vim (built from the source).
Does this issue happen if
$TERMis set totmux-256color?
Yes
I tried to reproduce the issue while using SSH (instead of mosh), but I couldn't. Similarly, I couldn't reproduce the issue locally on my Mac.
So I suspect this only happens when both mosh and tmux are used.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
what does mosh make different than a normal ssh connection?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I know the basic differences between the two, like the fact that mosh uses UDP as the transport protocol, uses SSH for the initial connection (authentication) but handles data encryption, etc., but I'm not sure which of these differences could be the likely cause of this issue.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
can you do :set all in both versions and diff the options?
Same for :set termcap?
You can use :redir to redirect the output to a file.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Same for :set termcap?
And append a bang to :set so that each terminal capability is on its own line; easier to find differences with this formatting:
:new | put =execute('set! termcap') | saveas /tmp/termcap.log
^
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I get identical outputs for both commands. Please see the outputs attached.
mosh_tmux_all.txt
mosh_tmux_termcap.txt
ssh_tmux_all.txt
ssh_tmux_termcap.txt
Output of :set all:
--- Options ---
aleph=224
noarabic
arabicshape
noallowrevins
ambiwidth=single
noautochdir
noautoshelldir
noautoindent
autoread
noautowrite
noautowriteall
background=light
backspace=indent,eol,start
nobackup
backupcopy=auto
backupdir=.,~/tmp,~/
backupext=~
backupskip=/tmp/*
balloondelay=600
noballoonevalterm
balloonexpr=
belloff=
nobinary
nobomb
breakat= ^I!@*-+;:,./?
nobreakindent
breakindentopt=
bufhidden=
buflisted
buftype=
casemap=internal,keepascii
nocdhome
cdpath=,,
cedit=^F
charconvert=
nocindent
cinkeys=0{,0},0),0],:,0#,!^F,o,O,e
cinoptions=
cinscopedecls=public,protected,private
cinwords=if,else,while,do,for,switch
clipboard=exclude:cons\|linux
cmdheight=1
cmdwinheight=7
colorcolumn=80
columns=92
comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
commentstring=/*%s*/
nocompatible
complete=.,w,b,u,t,i
concealcursor=
conceallevel=0
completefunc=
completeopt=menu,preview
completepopup=
noconfirm
nocopyindent
cpoptions=aABceFs
cryptmethod=blowfish2
cscopepathcomp=0
cscopeprg=cscope
cscopequickfix=
nocscoperelative
nocscopetag
cscopetagorder=0
nocscopeverbose
nocursorbind
nocursorcolumn
cursorline
cursorlineopt=both
debug=
define=^\s*#\s*define
nodelcombine
dictionary=
nodiff
diffexpr=
diffopt=internal,filler,closeoff
nodigraph
directory=.,~/tmp,/var/tmp,/tmp
display=
eadirection=both
noedcompatible
emoji
encoding=utf-8
noendoffile
endofline
equalalways
equalprg=
noerrorbells
errorfile=errors.err
errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory %*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMaking %*\a in %f,%f|%l| %m
esckeys
eventignore=
expandtab
noexrc
fileencoding=
fileencodings=ucs-bom,utf-8,default,latin1
fileformat=unix
fileformats=unix,dos
nofileignorecase
filetype=
fillchars=vert:|,fold:-,eob:~,lastline:@
fixendofline
foldclose=
foldcolumn=0
foldenable
foldexpr=0
foldignore=#
foldlevel=99
foldlevelstart=-1
foldmarker={{{,}}}
foldmethod=indent
foldminlines=1
foldnestmax=20
foldopen=block,hor,mark,percent,quickfix,search,tag,undo
foldtext=foldtext()
formatexpr=
formatoptions=tcq
formatlistpat=^\s*\d\+[\]:.)}\t ]\s*
formatprg=
fsync
nogdefault
grepformat=%f:%l:%m,%f:%l%m,%f %l%m
grepprg=grep -n $* /dev/null
guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block
helpfile=/projects/nullanet/miniconda3/envs/transformers_nazemi/share/vim/vim90/doc/help.txt
helpheight=20
helplang=en
hidden
highlight=8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC
history=1000
nohkmap
nohkmapp
hlsearch
noicon
iconstring=
ignorecase
imactivatefunc=
noimcmdline
noimdisable
iminsert=0
imsearch=-1
imstatusfunc=
include=^\s*#\s*include
includeexpr=
noincsearch
indentexpr=
indentkeys=0{,0},0),0],:,0#,!^F,o,O,e
noinfercase
noinsertmode
isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=
isident=@,48-57,_,192-255
iskeyword=@,48-57,_,192-255
isprint=@,161-255
joinspaces
key=
keymap=
keymodel=
keyprotocol=kitty:kitty,foot:kitty,wezterm:kitty,xterm:mok2
keywordprg=man
langmap=
langmenu=
nolangnoremap
langremap
laststatus=2
nolazyredraw
nolinebreak
lines=36
nolisp
lispoptions=
lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object
nolist
listchars=eol:$
loadplugins
magic
makeef=
makeencoding=
makeprg=make
matchpairs=(:),{:},[:]
matchtime=5
maxcombine=2
maxfuncdepth=100
maxmapdepth=1000
maxmem=528317464
maxmempattern=1000
maxmemtot=528317464
menuitems=25
mkspellmem=460000,2000,500
modeline
nomodelineexpr
modelines=5
modifiable
nomodified
more
mouse=
mousemodel=extend
mousetime=500
nrformats=bin,octal,hex
number
numberwidth=4
omnifunc=
operatorfunc=
packpath=~/.vim,/projects/nullanet/miniconda3/envs/transformers_nazemi/share/vim/vimfiles,/projects/nullanet/miniconda3/envs/transformers_nazemi/share/vim/vim90,/projects/nullanet/miniconda3/envs/transformers_nazemi/share/vim/vimfiles/after,~/.vim/after
paragraphs=IPLPPPQPP TPHPLIPpLpItpplpipbp
nopaste
pastetoggle=
patchexpr=
patchmode=
path=.,/usr/include,,
nopreserveindent
previewheight=12
previewpopup=
nopreviewwindow
printdevice=
printencoding=
printexpr=system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error
printfont=courier
printheader=%<%f%h%m%=Page %N
printmbcharset=
printmbfont=
printoptions=
prompt
pumheight=0
pumwidth=15
pythonthreehome=
pyxversion=3
quickfixtextfunc=
quoteescape=\
noreadonly
redrawtime=2000
regexpengine=0
relativenumber
remap
report=2
norevins
norightleft
rightleftcmd=search
noruler
rulerformat=
runtimepath=~/.vim,~/.vim/plugged/undotree,~/.vim/plugged/vim-undodir-tree,~/.vim/plugged/vim-airline,~/.vim/plugged/vim-airline-themes,~/.vim/plugged/tmuxline.vim,~/.vim/plugged/vim-bufferline,~/.vim/plugged/vim-bufkill,~/.vim/plugged/context.vim,~/.vim/plugged/vim-bufonly,~/.vim/plugged/SimpylFold,~/.vim/plugged/indentpython.vim,~/.vim/plugged/coc.nvim,~/.vim/plugged/vim-snippets,~/.vim/plugged/vista.vim,~/.vim/plugged/syntastic,~/.vim/plugged/black,~/.vim/plugged/fzf,~/.vim/plugged/fzf.vim,~/.vim/plugged/vim-fugitive,~/.vim/plugged/vim-gitgutter,~/.vim/plugged/gruvbox,~/.vim/plugged/vim-log-highlighting,~/.vim/plugged/sunset,~/.vim/plugged/rainbow,~/.vim/plugged/vim-highlightedyank,~/.vim/plugged/quick-scope,~/.vim/plugged/coc_current_word,~/.vim/plugged/terminus,~/.vim/plugged/vim-smooth-scroll,~/.vim/plugged/nerdcommenter,~/.vim/plugged/vim-unimpaired,~/.vim/plugged/vim-surround,~/.vim/plugged/vim-commentary,~/.vim/plugged/vim-exchange,~/.vim/plugged/vim-ReplaceWithRegister,~/.vim/plugged/vim-sort-motion,~/.vim/plugged/vim-system-copy,~/.vim/plugged/vim-tbone,~/.vim/plugged/vim-indent-object,~/.vim/plugged/vim-pythonsense,~/.vim/plugged/vim-textobj-entire,~/.vim/plugged/vim-textobj-user,~/.vim/plugged/argtextobj.vim,~/.vim/plugged/vim-textobj-line,~/.vim/plugged/vim-matchit,~/.vim/plugged/vim-python-matchit,~/.vim/plugged/vim-repeat,~/.vim/plugged/vim-easymotion,~/.vim/plugged/vim-numbertoggle,/projects/nullanet/miniconda3/envs/transformers_nazemi/share/vim/vimfiles,/projects/nullanet/miniconda3/envs/transformers_nazemi/share/vim/vim90,/projects/nullanet/miniconda3/envs/transformers_nazemi/share/vim/vimfiles/after,~/.vim/plugged/vim-pythonsense/after,~/.vim/after,~/.config/coc/extensions/node_modules/coc-snippets
scroll=8
noscrollbind
scrolljump=1
scrolloff=0
scrollopt=ver,jump
sections=SHNHH HUnhsh
nosecure
selection=inclusive
selectmode=
sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize,terminal
shell=/bin/zsh
shellcmdflag=-c
shellpipe=2>&1| tee
shellquote=
shellredir=>%s 2>&1
shelltemp
shellxquote=
shellxescape=
noshiftround
shiftwidth=4
shortmess=filnxtToOS
noshortname
showbreak=
noshowcmd
showcmdloc=last
noshowfulltag
noshowmatch
showmode
showtabline=1
sidescroll=0
sidescrolloff=0
signcolumn=yes
smartcase
nosmartindent
nosmarttab
nosmoothscroll
softtabstop=4
nospell
spellcapcheck=[.?!]\_[\])'"^I ]\+
spellfile=
spelllang=en
spelloptions=
spellsuggest=best
splitbelow
splitkeep=cursor
splitright
startofline
statusline=%!airline#statusline(2)
suffixes=.bak,~,.o,.h,.info,.swp,.obj
suffixesadd=
noswapfile
swapsync=fsync
switchbuf=
synmaxcol=3000
syntax=
tabline=
tabpagemax=10
tabstop=8
tagbsearch
tagcase=followic
tagfunc=
taglength=0
tagrelative
tags=tags;
tagstack
term=screen-256color
notermbidi
termencoding=
termguicolors
termwinkey=
termwinscroll=10000
termwinsize=
noterse
textauto
notextmode
textwidth=0
thesaurus=
thesaurusfunc=
notildeop
timeout
timeoutlen=1000
notitle
titlelen=85
titleold=Thanks for flying Vim
titlestring=
nottimeout
ttimeoutlen=1
ttybuiltin
ttyfast
ttymouse=xterm
ttyscroll=999
ttytype=screen-256color
undodir=~/.vim/undodir
noundofile
undolevels=1000
undoreload=10000
updatecount=200
updatetime=100
varsofttabstop=
vartabstop=
verbose=0
verbosefile=
viewdir=~/.vim/view
viewoptions=folds,options,cursor,curdir
viminfo='100,<50,s10,h
viminfofile=
virtualedit=
novisualbell
warn
noweirdinvert
whichwrap=b,s
wildchar=<Tab>
wildcharm=0
wildignore=
nowildignorecase
wildmenu
wildmode=longest:full,full
wildoptions=
wincolor=
window=35
winheight=1
nowinfixheight
nowinfixwidth
winminheight=1
winminwidth=1
winwidth=20
wrap
wrapmargin=0
wrapscan
write
nowriteany
nowritebackup
writedelay=0
xtermcodes
Output of :set termcap:
--- Terminal codes ---
t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m
t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m
t_AU=
t_AL=^[[%p1%dL
t_al=^[[L
t_bc=
t_BE=
t_BD=
t_cd=^[[J
t_ce=^[[K
t_Ce=
t_cl=^[[H^[[J
t_cm=^[[%i%p1%d;%p2%dH
t_Co=256
t_CS=
t_Cs=
t_cs=^[[%i%p1%d;%p2%dr
t_CV=
t_da=
t_db=
t_DL=^[[%p1%dM
t_dl=^[[M
t_ds=
t_Ds=
t_EC=
t_EI=^[Ptmux;^[^[[2 q^[\
t_fs=^G
t_fd=
t_fe=
t_GP=
t_IE=
t_IS=
t_ke=^[[?1l^[>
t_ks=^[[?1h^[=
t_le=^H
t_mb=^[[5m
t_md=^[[1m
t_me=^[[0m
t_mr=^[[7m
t_ms=y
t_nd=^[[C
t_op=^[[39;49m
t_RF=
t_RB=
t_RC=
t_RI=^[[%p1%dC
t_Ri=
t_RK=
t_RS=
t_RT=
t_RV=
t_Sb=
t_SC=
t_se=^[[23m
t_Sf=
t_SH=
t_SI=^[Ptmux;^[^[[6 q^[\
t_Si=
t_so=^[[3m
t_SR=^[Ptmux;^[^[[4 q^[\
t_sr=^[M
t_ST=
t_Te=
t_te=^[[?1049l
t_TE=
t_ti=^[[?1049h
t_TI=
t_Ts=
t_ts=^[]2;
t_u7=^[[6n
t_ue=^[[24m
t_us=^[[4m
t_Us=
t_ut=
t_vb=^[g
t_ve=^[[34h^[[?25h
t_vi=^[[?25l
t_VS=
t_vs=^[[34l
t_WP=
t_WS=
t_XM=
t_xn=y
t_xs=
t_ZH=^[[7m
t_ZR=^[[0m
t_8f=^[[38;2;%lu;%lu;%lum
t_8b=^[[48;2;%lu;%lu;%lum
t_8u=^[[58;2;%lu;%lu;%lum
--- Terminal keys ---
t_@7 <End> ^[[4~
t_F1 <F11> ^[[23~
t_F2 <F12> ^[[24~
t_k1 <F1> ^[OP
t_k2 <F2> ^[OQ
t_k3 <F3> ^[OR
t_k4 <F4> ^[OS
t_k5 <F5> ^[[15~
t_k6 <F6> ^[[17~
t_k7 <F7> ^[[18~
t_k8 <F8> ^[[19~
t_k9 <F9> ^[[20~
t_k; <F10> ^[[21~
t_kB <S-Tab> ^[[Z
t_kD <Del> ^[[3~
t_kI <Insert> ^[[2~
t_kN <PageDown> ^[[6~
t_kP <PageUp> ^[[5~
t_kb <BS> ^?
t_kd <Down> ^[OB
t_kh <Home> ^[[1~
t_kl <Left> ^[OD
t_kr <Right> ^[OC
t_ku <Up> ^[OA
<Mouse> ^[[M
<FocusGained> ^[[I
<FocusLost> ^[[O
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
No idea what the issue is, but since you mentioned that it was specific to tmux, have a look at :help tmux-integration. In particular the block about true colors:
if !has('gui_running') && &term =~ '^\%(screen\|tmux\)'
...
" Enable true colors, see :help xterm-true-color
let &termguicolors = v:true
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
...
endif
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thank you for the suggestion. I will test these recommendations and provide an update if they help. However, it is worth noting that I only encounter this behavior when utilizing the mosh/tmux combination, not when utilizing the ssh/tmux combination, so tmux alone may not be the culprit.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
what does mosh make different than a normal ssh connection?
It drops data to make programs more responsive:
It has been known to drop data (at least in the distant past when I first learned about it).
Mosh causes problems like you're seeing due to its optimization of traffic to drop what it considers irrelevant data in order to maximize interactive responsiveness.
Which might be the cause of this issue.
It's probably not a bug in tmux, because the devs over there consider that if an issue can be reproduced in mosh but not ssh, then the issue is in mosh, not tmux:
If it only happens in mosh not in ssh then it is probably a mosh issue.
Does it happen with ssh instead of mosh?
[...] It does not happen with ssh but does happen with mosh [...]
Seems like a mosh problem then.
@MahdiNazemi: You might want to try to reproduce with no tmux config:
$ tmux -Lx -f /dev/null
Also, the screenshots are nice but we can't read the exact contents of the file. In particular, what are these bar characters? For example, between First and Second, is it a regular | from the ASCII table (U+007C), or something beyond like │ (U+2502)?
If it's a bug in mosh, you might want to report it on their bug tracker. I briefly looked at it, as well as the tmux one, and found these reports which might be relevant (or not):
Untested, but you might also be interested in Eternal Terminal, which was suggested on one of the reports I skimmed through:
At some point I switched from mosh to Eternal Terminal - https://mistertea.github.io/EternalTerminal/ so that may solve your problem if you don't mind the switch.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks very much for your comprehensive reply, one of the best I've ever seen on GitHub.
You might want to try to reproduce with no tmux config:
$ tmux -Lx -f /dev/null
I tried running tmux once with the default config (earlier today) and once with the command you shared (right now). None of them resolved the issue.
In particular, what are these bar characters? For example, between First and Second, is it a regular | from the ASCII table (U+007C), or something beyond like │ (U+2502)?
Sorry about the confusion. The pipes are used as column separators in a table in the markdown file I was working on. The line wraps at the word "screen" where "s" is at the end of the top line on the screen and "creen" is at the beginning of the bottom line on the screen. After selection the line with V the following occur:
I will open an issue on mosh's GitHub repository (or use an existing one) and close this one for now. I will report back here if I find a solution.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #13101 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Eternal Terminal does not suffer from this issue, and has been working well so far.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()