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

Vimrc with tmux breaks Ctrl+Shift+V paste in normal mode #763

Open
Gotoro opened this issue Oct 11, 2024 · 1 comment · May be fixed by #764
Open

Vimrc with tmux breaks Ctrl+Shift+V paste in normal mode #763

Gotoro opened this issue Oct 11, 2024 · 1 comment · May be fixed by #764

Comments

@Gotoro
Copy link

Gotoro commented Oct 11, 2024

As described, vimrc mangles the paste when using Ctrl+Shift+V in normal mode. It consumes sometimes first 2 characters, sometimes much more as in the first screenshot and breaks all newlines and tabulation. When using insert mode, the characters are not consumed but newlines still break.

Upper vim is started with default vimrc + tmux. Lower vim is started with vim -u NONE (to start it default) + tmux. This is from my machine. I'm using Arch + alacritty + zsh (with oh-my-zsh) + tmux + vim + vimrc here.
image

As you can see, the lower sections pastes correctly, doesn't consume characters, the newlines and tabulation exists as it should.

Experimentally I've determined this to be the problem with filetypes.vim configuration

set term=screen-256color

Setting this to xterm-256color for example fixes the problem. Perhaps setting other settings here may help, I'm not too knowledgeable of what this does, aside from something to do with colors.

Here it's set to xterm-256color
image

To determine whether this is a problem with my configuration, I've created a simple docker container which starts an arch machine, with everything needed to run vim + vimrc + tmux.
Dockerfile.txt

FROM archlinux:latest
# Arch bootstrap as per container instructions
RUN pacman-key --init && \
pacman -Syu --noconfirm 

# Install packages
RUN pacman -S git curl tmux vim --noconfirm  

# Make tmux run on bash start
RUN echo "tmux" >> ~/.bashrc

# Install vimrc
RUN git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime && \
sh ~/.vim_runtime/install_awesome_vimrc.sh

# Run bash 
CMD ["bash"]

This one is inside the mentioned docker container. It breaks too, with minimal configuration.
image

And finally, changing this to xterm-256color inside of the container makes it work.
image

I've tried this with other terminals (namely kitty, konsole, gnome terminal) and shells (bash is used in the docker container) as well, so I'm excluding them from being culprits for now.

@Gotoro Gotoro linked a pull request Oct 11, 2024 that will close this issue
@Gotoro
Copy link
Author

Gotoro commented Oct 11, 2024

Update: setting termguicolors when vim is compiled with it fixes the problem #764

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

Successfully merging a pull request may close this issue.

1 participant