Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Unreleased
-------------------------

* [Enhancement] Add Mac Cmd+V paste support for the lab terminal.
* [Bug fix] Rename the CSS class for labs from `hastexblock` to `stackamolexblock`, post the XBlock rename.

Version 9.0.0 (2026-05-13)
Expand Down
15 changes: 13 additions & 2 deletions stackamole/public/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,37 @@ function StackamoleGuacamoleClient(configuration) {

/* Keyboard handling. */
var keyboard = new Guacamole.Keyboard(terminal_element);
var ctrl, shift = false;
var ctrl, shift, cmd = false;

keyboard.onkeydown = function (keysym) {
var cancel_event = true;

/* Don't cancel event on paste shortcuts. */
if (keysym == 0xFFE1 /* shift */
|| keysym == 0xFFE3 /* ctrl */
|| keysym == 0xFFE7 /* cmd (left) */
|| keysym == 0xFFE8 /* cmd (right) */
|| keysym == 0xFF63 /* insert */
|| keysym == 0x0056 /* V */
|| keysym == 0x0076 /* v */
) {
cancel_event = false;
}

/* Remember when ctrl or shift are down. */
/* Remember when ctrl, shift or cmd are down. */
if (keysym == 0xFFE1) {
shift = true;
} else if (keysym == 0xFFE3) {
ctrl = true;
} else if (keysym == 0xFFE7 || keysym == 0xFFE8) {
cmd = true;
}

// Don't send any key event when running cmd-v on a Mac, to avoid
// typing a 'v' in the terminal.
// just return, to register the paste event
if (cmd && keysym == 0x0076) { /* cmd-v */
return !cancel_event;
}

/* Delay sending final stroke until clipboard is updated. */
Expand Down
Loading