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 · 13 comments

Comments

@mingwandroid
Copy link

commented Dec 10, 2017

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

This comment has been minimized.

Copy link
Owner

commented Dec 10, 2017

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

@marksandler2

This comment has been minimized.

Copy link

commented Jan 29, 2018

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

This comment has been minimized.

Copy link
Owner

commented Jan 29, 2018

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

This comment has been minimized.

Copy link

commented Jan 29, 2018

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

This comment has been minimized.

Copy link
Owner

commented Jan 30, 2018

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

This comment has been minimized.

Copy link

commented Feb 6, 2018

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

This comment has been minimized.

Copy link
Owner

commented Feb 7, 2018

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Feb 18, 2019

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

@nutcr4cker

This comment has been minimized.

Copy link

commented Mar 27, 2019

keep finger crossed for that improvement as its a bit annoying

@accountgit

This comment has been minimized.

Copy link

commented May 10, 2019

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

@maroony

This comment has been minimized.

Copy link

commented Jul 12, 2019

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

@sedwards2009 sedwards2009 added prio:high and removed prio:low labels Aug 7, 2019
@sedwards2009 sedwards2009 referenced this issue Aug 17, 2019
106 of 132 tasks complete
@sedwards2009

This comment has been minimized.

Copy link
Owner

commented Sep 15, 2019

Released in v0.45.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.