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

feat: distinguish actual scrollback newlines vs vim.o.columns hardwrapped newlines #78

Open
neg-serg opened this issue Nov 28, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@neg-serg
Copy link

neg-serg commented Nov 28, 2023

Steps to reproduce:

Generate extremely long newline, for example:

for t in {1..100}; do echo -ne eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeemmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm;

There is only one long string here, but it's impossible to select with pager as the single line. In the same time with the mouse it remains be possible via kitty scroll-back.
Is there any way to get around this problem?

This can often be seen in practice when parsing absurdly large log lines. After this, they are very inconvenient to copy using the keyboard, which adds manual work. The problem can be worked around using tmux, but it increase overall latency.

@mikesmithgh
Copy link
Owner

Reproduced:

#!/bin/bash

for ((i = 0; i < 90; i++)); do
	echo -n "123456789|"
done

echo
reproduced-300-wrap.mov

Setting vim.o.columns to 300 here https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/main/lua/kitty-scrollback/launch.lua#L375

@mikesmithgh
Copy link
Owner

Hey @neg-serg thanks for the issue, so the problem is around the number of columns I have set for Neovim (currently 300). When kitty-scrollback.nvim reads the scrollback buffer into neovim's terminal it hard wraps at 300. When I increase vim.o.columns during processing it starts to reduce the performance. I'll have to think if there is a decent way to work around this.

When you say workaround with tmux, what exactly do you mean?

@neg-serg
Copy link
Author

If you copy this string with tmux you get one string only, without additional newlines.
2023-11-29_13-47
Using tmux selection with clipboard integration get you the same result as with kitty-scrollback via mouse.

You have 10000 columns limit in modern vim/neovim, after that strings going to be wrapped.
The problem here that you cannot distinguish newlines from wrapping and newlines from output via pager.

@mikesmithgh mikesmithgh self-assigned this Nov 30, 2023
@mikesmithgh mikesmithgh changed the title Add some hack to distinguish true newlines from output vs "newlines" from pager feat: distinguish actual scrollback newlines vs vim.o.columns hardwrapped newlines Dec 1, 2023
@mikesmithgh mikesmithgh added the enhancement New feature or request label Dec 1, 2023
@mikesmithgh mikesmithgh removed their assignment Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants