Skip to content

Commit 1d4c611

Browse files
committed
fix meta-enter handling
1 parent 9f57033 commit 1d4c611

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/runtime/console.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,14 @@ function addLinkHandler (terminal) {
252252
}
253253

254254
function handleKeybinding (e, term, binds = whitelistedKeybindingsTerminal) {
255-
if (binds.indexOf(atom.keymaps.keystrokeForKeyboardEvent(e)) > -1) {
256-
// allow users to let key events to fall through to Atom's handler
255+
if (e.keyCode === 13 && (e.altKey || e.metaKey) && e.type === 'keydown') {
256+
// Meta-Enter doesn't work properly with xterm.js atm, so we send the right escape sequence ourselves:
257+
if (term.ty) {
258+
term.ty.write('\x1b\x0d')
259+
}
260+
return false
261+
} else if (binds.indexOf(atom.keymaps.keystrokeForKeyboardEvent(e)) > -1) {
262+
// let certain user defined key events fall through to Atom's handler
257263
return false
258264
}
259265
return e

0 commit comments

Comments
 (0)