Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Visual selection of a wrapped line in Vim shows incorrect characters #1295

Open
MahdiNazemi opened this issue Sep 17, 2023 · 0 comments

Comments

@MahdiNazemi
Copy link

MahdiNazemi commented Sep 17, 2023

Steps to reproduce

  1. Create a file named 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
  1. Open a tmux session by running tmux -Lx -f /dev/null.

  2. Open a file with wrapped lines while using the above Vim preferences, e.g., vim -u mini.vim README.md (the screenshots below show a row of a table written in markdown).

  3. See how visual selection of a wrapped line with V moves some characters to the number column and eliminates some other characters. 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 selecting the line with V the following occur:

  • The letter "s" is dropped and the letter "c" in "screen" becomes the last character in the top line.
  • The bottom line is dedented and starts right below the number column where naturally, there should be no text.

Before visual selection:
Before

After visual selection:
After

Expected behaviour

The expected behavior is for the characters to remain in their original position.

Version of mosh

Built from the source (1105d48)

Version of Vim

9.0.1435 (tested with the latest version (1901) as well)

Version of tmux

3.2a (tested with the latest version (3.3a) as well)

Environment

Operating system: Ubuntu 22.04 accessed through mosh via macOS Ventura 13.5.2
Terminal: iTerm 2
Value of $TERM: screen-256color
Shell: zsh

This issue only occurs when using mosh and inside a tmux session. Using SSH, opening Vim outside a tmux session, or local Vim/tmux do not exhibit the same behavior.

(Possibly) Related Bugs

Screen corruption with neovim (#1041)

This bug was originally reported on Vim's GitHub repository (#13101), but after a few discussions and comparison with SSH, the mosh/tmux combination seems to be the culprit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant