Skip to content

Commit

Permalink
Convert LF to CR when pasting into the terminal.
Browse files Browse the repository at this point in the history
Previously, copying and pasting multiple lines from, say, Notepad, into
jediterm didn't work.  winpty turned each LF into Ctrl-Return rather than
Return.
  • Loading branch information
rprichard committed May 19, 2016
1 parent ff343d1 commit 55d9d53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src-terminal/com/jediterm/terminal/ui/TerminalPanel.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,10 @@ protected void pasteSelection() {
}

try {
myTerminalStarter.sendString(selection);
// When we read the clipboard contents on Windows, Java replaces any
// instances of CRLF with LF. A terminal enter/return key is encoded as
// CR, though, not LF. (Ctrl-Return generates LF.) Convert LF to CR.
myTerminalStarter.sendString(selection.replace('\n', '\r'));
} catch (RuntimeException e) {
LOG.info(e);
}
Expand Down

0 comments on commit 55d9d53

Please sign in to comment.