Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/shell/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,19 @@ export class Job extends EmitterWithUniqueID implements TerminalLikeDevice {
if (typeof input === "string") {
text = input;
} else {
text = input.ctrlKey ? String.fromCharCode(input.keyCode - 64) : normalizeKey(input.key, this.screenBuffer.cursorKeysMode);
if (input.ctrlKey) {
text = String.fromCharCode(input.keyCode - 64);
} else if (input.altKey) {
let char = String.fromCharCode(input.keyCode);
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't input.key already in the proper case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my testing input.key is the special char macOS generates, ∂ for alt+d for example.

if (input.shiftKey) {
char = char.toUpperCase();
} else {
char = char.toLowerCase();
}
text = `\x1b${char}`;
} else {
text = normalizeKey(input.key, this.screenBuffer.cursorKeysMode);
}
}

this.command.write(text);
Expand Down