Skip to content
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
46 changes: 41 additions & 5 deletions frontend/app/view/term/term-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,42 @@ export class TermViewModel implements ViewModel {
this.setTermMode(newTermMode);
return true;
}
if (keyutil.checkKeyPressed(waveEvent, "Shift:End")) {
if (this.termRef?.current?.terminal) {
this.termRef.current.terminal.scrollToBottom();
}
return true;
}
if (keyutil.checkKeyPressed(waveEvent, "Shift:Home")) {
if (this.termRef?.current?.terminal) {
this.termRef.current.terminal.scrollToLine(0);
}
return true;
}
if (isMacOS() && keyutil.checkKeyPressed(waveEvent, "Cmd:End")) {
if (this.termRef?.current?.terminal) {
this.termRef.current.terminal.scrollToBottom();
}
return true;
}
if (isMacOS() && keyutil.checkKeyPressed(waveEvent, "Cmd:Home")) {
if (this.termRef?.current?.terminal) {
this.termRef.current.terminal.scrollToLine(0);
}
return true;
}
if (keyutil.checkKeyPressed(waveEvent, "Shift:PageDown")) {
if (this.termRef?.current?.terminal) {
this.termRef.current.terminal.scrollPages(1);
}
return true;
}
if (keyutil.checkKeyPressed(waveEvent, "Shift:PageUp")) {
if (this.termRef?.current?.terminal) {
this.termRef.current.terminal.scrollPages(-1);
}
return true;
}
const blockData = globalStore.get(this.blockAtom);
if (blockData.meta?.["term:mode"] == "vdom") {
const vdomModel = this.getVDomModel();
Expand All @@ -502,16 +538,16 @@ export class TermViewModel implements ViewModel {
if (isMacOS()) {
return false;
}

// Get the app:ctrlvpaste setting
const ctrlVPasteAtom = getSettingsKeyAtom("app:ctrlvpaste");
const ctrlVPasteSetting = globalStore.get(ctrlVPasteAtom);

// If setting is explicitly set, use it
if (ctrlVPasteSetting != null) {
return ctrlVPasteSetting;
}

// Default behavior: Windows=true, Linux/other=false
return isWindows();
}
Expand Down Expand Up @@ -545,15 +581,15 @@ export class TermViewModel implements ViewModel {
return false;
}
}

// Check for Ctrl-V paste (platform-dependent)
if (this.shouldHandleCtrlVPaste() && keyutil.checkKeyPressed(waveEvent, "Ctrl:v")) {
event.preventDefault();
event.stopPropagation();
getApi().nativePaste();
return false;
}

if (keyutil.checkKeyPressed(waveEvent, "Ctrl:Shift:v")) {
event.preventDefault();
event.stopPropagation();
Expand Down