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

Copying a wrapped line does not work as it should #69

Closed
mingwandroid opened this issue Dec 10, 2017 · 14 comments
Closed

Copying a wrapped line does not work as it should #69

mingwandroid opened this issue Dec 10, 2017 · 14 comments

Comments

@mingwandroid
Copy link

If you copy a very long line that has been wrapped over multiple lines and paste it again, it is pasted as multiple lines split where the wrapping occurred.

@sedwards2009
Copy link
Owner

This feature is closely related to general feature of "word wrap on resize".

@marksandler2
Copy link

so, what's the recommended way of copy pasting item to avoid spurious newlines (suppose i am not resizing window). This is particularly important when i am copying/pasting commands.

@sedwards2009
Copy link
Owner

The closest thing to recommended way is to paste your lines into a text editor manually fix the lines, select and copy again. Yes I know it is not a great solution.

@marksandler2
Copy link

Thanks, yeah, thats not very useful indeed. :-) So looking at the dev panel it appears that extraterm uses codemirror for rendering outputs - code mirror support line word wrapping natively, (https://codemirror.net/demo/indentwrap.html)

So if extraterm can feed complete lines to codemirror, then the right thing should automatically happen.

@sedwards2009
Copy link
Owner

Getting codemirror to do wrapping for lines shouldn't be super hard for lines which have entered the scrollback. For lines which are still on the screen and can be modified via terminal escape codes, the situation is trickier.

@marksandler2
Copy link

My preference is for terminal to treat long lines that wrapped over as a single line from the perspective of terminal escape codes, rather than multiple lines. E.g. term-> go to the beginning of the line should go to the real the beginning of the line (that is where it would go if terminal had infinite width), not to the same on-screen line. I believe this is also the expectation for most of applications but i could be wrong.

If you are open to this, i can see if i can fix this with minimal blood though pointers are appreciated.

@sedwards2009
Copy link
Owner

I have a feeling that changing how the cursor behaves when it reaches the end of a row is a bad idea. I strongly suspect that some 'rich' terminal based UIs expect the cursor to appear on the next line. vttest already shows that Extraterm lacks a bit in its emulation already.

If you want to investigate this a bit more, then it makes sense to look in Term.ts, get a feel for how it works and think about how to flag rows as "wrapped" when the cursor runs off the end. This info could then be passed on to the rendering stage which could use it to 'correct' text when it is copied.

@psprint
Copy link

psprint commented Jan 25, 2019

I'm having the same problem: copying/pasting long, wrapped lines ––> copying multiple lines (should be: copying as single line, unless an actual \n occurs in the selected text)

@zicklag
Copy link

zicklag commented Feb 18, 2019

👍 for this. It can be pretty difficult when I want to copy output from Extraterm if it wraps.

@nutcr4cker
Copy link

keep finger crossed for that improvement as its a bit annoying

@accountgit
Copy link

Tried in current release and continues happening.
Will be a VERY welcome feature.

@maroony
Copy link

maroony commented Jul 12, 2019

Please fix this. Every other terminal emulator behaves that way.

@sedwards2009
Copy link
Owner

Released in v0.45.0.

@maroony
Copy link

maroony commented Dec 12, 2019

The problem still exists when you try to copy & paste a line within extraterm 0.48.0:

$ echo A very long ... 
line.

Now copy & paste this command and you get

$ echo A very long ...
$ line.

What you should get is

$ echo A very long ...
line.

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

No branches or pull requests

8 participants