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
Repl prepends whitespaces to wrapped lines causing issues with select+copy #205
Comments
Yep this is a problem. This is even worse for code, because the random spaces will probably break whatever snippet you were running and it won't even compile. Here's a solution that I just found: Fish Shell does this pretty neat thing: Where if your command takes more than one line, they kick it to the next line below the prompt and have it start from the far left. This preserves both the "normal" single-line experience, provides a properly-aligned multi-line experience, and allows correct C&P. |
That sounds like a sensible solution :) |
This continues to annoy me |
…n to the left if there's individual rows that multi-line due to wrapping, and not when there's simple `\n`s in the buffer that results in short rows. Given the problem statement of #205, this should solve it while still being relatively un-obtrusive in the common case where commands (even multi-line commands!) are short and do not wrap
The Repl prepends
prompt.size
whitespace characters to the beginning of new visual input lines (after soft wrapping). This makes it impossible (or dangerous) to copy using select + copy previous input from one shell to another because the contents may have changed depending on the terminal width and prompt size.Consider this example: (using a short terminal width):
Copying the first val (selecting everything from the first
"
to the last"
from the input) results int he following string"lorem ipsum and the r est lorem ipsum and the rest lor em ipsum and the rest lorem ipsu m and the rest lorem ipsum and t he rest lorem ipsum and the rest "
(notice the double-spaces added).The text was updated successfully, but these errors were encountered: