-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Copy of a single wrapped line from bash introduces new-lines #14035
Comments
This is a bit nuanced. bash (more accurately, probably readline) implements its own hard wrapping. As a result, we can't totally tell that a line was intended to be a continuation instead of a physical line break. When I type this: Bash sends this:
That space and newline were produced by them. I'm at a loss as to exactly why they do this. |
probably the command is actually executed because of this newline too |
maybe could be hacked around by a context menu command "Paste without newlines", but it's not very satisfactory |
Holding down Shift while you copy will force the entire selection to wrap onto a single line. It's not ideal because you won't necessarily know when to use it versus not use it, but it might be a good tactical solution for this specific issue. Sorry :/ |
Until now, I've been relying on auto-copy on mouse selection. I wonder, if Terminal can at least provide some visual hints on copy or on paste if the text includes new-lines to educate about this option. Btw Ctrl+Shift+C is default on Gnome Terminal, will this shortcut in WT also just apply these newline removal? or only if Shift is used during mouse-selection? |
Yea, I wonder if there's somewhere a mailing list or bash/readline authors that could address this... Does Mac's Terminals handle this somehow? |
Also, I don't know why but for me this problem doesn't happen every time, only occasionally. So there may be some other aspects |
I think I'm gonna call this a /dupe of #6901. We should probably go through and de-dupe the rest of those too. |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Windows Terminal version
1.14.2282.0
Windows build number
10.0.22000.978
Other Software
No response
Steps to reproduce
I have launched a long command in WSLv1 bash in Terminal, it looks like:
When I copy these two lines (e.g. for pasting later in another terminal for launching a similar command in parallel), Terminal introduces a newline which was not there originally. This prevents from a proper paste and (probably another issue) - also executes the incomplete command immediately after the paste. It's possible that I entered this command by pressing Up on keyboard which brought this command from bash history.
This must have been reported before, but I could not find an earlier issue just about this. If it indeed is a duplicate, please feel free to close this.
Expected Behavior
No response
Actual Behavior
No newline is introduced and command is not executed immediately after the paste in another tab
The text was updated successfully, but these errors were encountered: