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

Normalize line endings on paste #659

Merged
merged 1 commit into from
May 11, 2017
Merged

Normalize line endings on paste #659

merged 1 commit into from
May 11, 2017

Conversation

jdanyow
Copy link

@jdanyow jdanyow commented May 9, 2017

Enables pasting multi-line text into the terminal.

cc @EisenbergEffect, @yangl900, @DuncanmaMSFT

Fixes #660

@EisenbergEffect
Copy link

@Tyriar This the PR I mentioned in our email exchange earlier :)

@@ -68,6 +76,7 @@ export function pasteHandler(ev: ClipboardEvent, term: ITerminal) {
let text: string;

let dispatchPaste = function(text) {
text = prepareTextForTerminal(text);
Copy link
Member

@Tyriar Tyriar May 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should probably apply this only on Windows:

import { isMSWindows } from './Browser';
...
if (isMSWindows) {
  ...
}

Thoughts @jdanyow?

@Tyriar
Copy link
Member

Tyriar commented May 9, 2017

I created an issue for tracking and amended the top comment so it will close off automatically 😃

@Tyriar Tyriar added this to the 2.7.0 milestone May 9, 2017
* Prepares text to be pasted into the terminal by normalizing the line endings
* @param text The pasted text that needs processing before inserting into the terminal
*/
export function prepareTextForTerminal(text: string, isMSWindows: boolean): string {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this signature made the tests easy to implement- let me know if you'd rather see this rolled into dispatchPaste or some other form

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy tests are good 👌

@Tyriar
Copy link
Member

Tyriar commented May 10, 2017

@parisk coveralls doesn't seem to be completing, the build seems to have completed successfully though https://travis-ci.org/sourcelair/xterm.js/jobs/230548323

@parisk
Copy link
Contributor

parisk commented May 11, 2017

Seems to be OK now 😄 .

@parisk parisk merged commit 6dad013 into xtermjs:master May 11, 2017
@Tyriar
Copy link
Member

Tyriar commented Jun 8, 2017

I'm seeing some weird behavior after this. See #683

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

Successfully merging this pull request may close these issues.

4 participants