@aurigax-ai/ghostty-web 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/input-handler.ts +1 -10
- package/lib/terminal.ts +7 -1
- package/package.json +1 -1
package/lib/input-handler.ts
CHANGED
|
@@ -192,7 +192,6 @@ export class InputHandler {
|
|
|
192
192
|
private mousedownListener: ((e: MouseEvent) => void) | null = null;
|
|
193
193
|
private mouseupListener: ((e: MouseEvent) => void) | null = null;
|
|
194
194
|
private mousemoveListener: ((e: MouseEvent) => void) | null = null;
|
|
195
|
-
private wheelListener: ((e: WheelEvent) => void) | null = null;
|
|
196
195
|
private isComposing = false;
|
|
197
196
|
private isDisposed = false;
|
|
198
197
|
/**
|
|
@@ -319,9 +318,6 @@ export class InputHandler {
|
|
|
319
318
|
|
|
320
319
|
this.mousemoveListener = this.handleMouseMove.bind(this);
|
|
321
320
|
this.container.addEventListener('mousemove', this.mousemoveListener);
|
|
322
|
-
|
|
323
|
-
this.wheelListener = this.handleWheel.bind(this);
|
|
324
|
-
this.container.addEventListener('wheel', this.wheelListener, { passive: false });
|
|
325
321
|
}
|
|
326
322
|
|
|
327
323
|
/**
|
|
@@ -925,7 +921,7 @@ export class InputHandler {
|
|
|
925
921
|
/**
|
|
926
922
|
* Handle wheel event (scroll)
|
|
927
923
|
*/
|
|
928
|
-
|
|
924
|
+
handleWheel(event: WheelEvent): void {
|
|
929
925
|
if (this.isDisposed) return;
|
|
930
926
|
if (!this.mouseConfig?.hasMouseTracking()) return;
|
|
931
927
|
|
|
@@ -1129,11 +1125,6 @@ export class InputHandler {
|
|
|
1129
1125
|
this.mousemoveListener = null;
|
|
1130
1126
|
}
|
|
1131
1127
|
|
|
1132
|
-
if (this.wheelListener) {
|
|
1133
|
-
this.container.removeEventListener('wheel', this.wheelListener);
|
|
1134
|
-
this.wheelListener = null;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
1128
|
this.isDisposed = true;
|
|
1138
1129
|
}
|
|
1139
1130
|
|
package/lib/terminal.ts
CHANGED
|
@@ -1709,6 +1709,11 @@ export class Terminal implements ITerminalCore {
|
|
|
1709
1709
|
return;
|
|
1710
1710
|
}
|
|
1711
1711
|
|
|
1712
|
+
if (this.wasmTerm?.hasMouseTracking()) {
|
|
1713
|
+
this.inputHandler?.handleWheel(e);
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1712
1717
|
// Check if in alternate screen mode (vim, less, htop, etc.)
|
|
1713
1718
|
const isAltScreen = this.wasmTerm?.isAlternateScreen() ?? false;
|
|
1714
1719
|
|
|
@@ -1717,7 +1722,8 @@ export class Terminal implements ITerminalCore {
|
|
|
1717
1722
|
// Applications like vim handle scrolling internally
|
|
1718
1723
|
// Standard: ~3 arrow presses per wheel "click"
|
|
1719
1724
|
const direction = e.deltaY > 0 ? 'down' : 'up';
|
|
1720
|
-
const
|
|
1725
|
+
const lines = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? e.deltaY : e.deltaY / 33;
|
|
1726
|
+
const count = Math.min(Math.abs(Math.round(lines)), 5); // Cap at 5
|
|
1721
1727
|
|
|
1722
1728
|
for (let i = 0; i < count; i++) {
|
|
1723
1729
|
if (direction === 'up') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurigax-ai/ghostty-web",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Ghostty's terminal engine (libghostty-vt) in the browser: WebAssembly build, an xterm.js-shaped API and WebGL and canvas renderers. A hard fork of coder/ghostty-web.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.ts",
|