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 terminal output copies all trailing whitespace #66

Closed
Tyriar opened this issue Jun 2, 2016 · 5 comments
Closed

Copying terminal output copies all trailing whitespace #66

Tyriar opened this issue Jun 2, 2016 · 5 comments
Labels
type/bug Something is misbehaving

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 2, 2016

Copying this:

image

Pasted result:

image

@parisk parisk added the type/bug Something is misbehaving label Jun 2, 2016
@parisk
Copy link
Contributor

parisk commented Jun 2, 2016

Thanks for reporting. Will take a look into how could we avoid that. Most probably it will be a hook on the copy event.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 4, 2016

What are your thoughts on pulling in an npm dependency so that xterm.js is no longer self contained? Specifically clipboard.js as copying to clipboard seems especially tricky in a browser scenario.

parisk added a commit that referenced this issue Jun 5, 2016
- Do not actually cut on cut
- Strip trailing whitespaces on copy (fix #66)
@parisk
Copy link
Contributor

parisk commented Jun 6, 2016

@Tyriar we prefer keeping xterm.js as a self-contained library. It seems that we managed to fix this relatively easy in c02cc84 though, without any external dependencies.

Feel free to try this out! It would help us moving forward with merging of #78.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 6, 2016

I was doing essentially the same thing only ev.clipboardData.setData('text/plain', copiedText); didn't seem to be working in Chrome (needed more tinkering) and support across other older browsers is limited with this approach.

@parisk parisk closed this as completed in #78 Jun 7, 2016
@parisk
Copy link
Contributor

parisk commented Jun 7, 2016

I tried across multiple browsers and this seemed to work everywhere.

Support across older browsers is not a priority for this library though at the moment, thus let's keep this simple until another issue comes up with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is misbehaving
Projects
None yet
Development

No branches or pull requests

2 participants