| ... | ... | @@ -942,6 +942,22 @@ export class GhosttyTerminalSurface { |
| 942 | 942 | }, 150); |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | /** |
| 946 | * Releasing a panel, drawer, or split divider settles the size, so the PTY |
| 947 | * hears it now instead of after the debounce. Otherwise typing right after |
| 948 | * the release reaches a shell that still lays out the old width. |
| 949 | */ |
| 950 | private readonly onWindowPointerRelease = () => { |
| 951 | if (this.disposed || this.resizeNotifyTimer === null) return; |
| 952 | // The drag hook writes the release position before this bubbles to window, |
| 953 | // so fit now rather than wait a frame for the observer. |
| 954 | this.fit(); |
| 955 | if (this.resizeNotifyTimer === null) return; |
| 956 | window.clearTimeout(this.resizeNotifyTimer); |
| 957 | this.resizeNotifyTimer = null; |
| 958 | this.options.onResize(this.cols, this.rows); |
| 959 | }; |
| 960 | |
| 945 | 961 | focus(): void { |
| 946 | 962 | if (this.disposed || !this.visible) return; |
| 947 | 963 | this.input.focus({ preventScroll: true }); |
| ... | ... | @@ -1843,6 +1859,8 @@ export class GhosttyTerminalSurface { |
| 1843 | 1859 | this.scrollbar.addEventListener("pointerup", this.onScrollbarPointerUp); |
| 1844 | 1860 | this.scrollbar.addEventListener("pointercancel", this.onScrollbarPointerUp); |
| 1845 | 1861 | this.scrollbar.addEventListener("keydown", this.onScrollbarKeyDown); |
| 1862 | window.addEventListener("pointerup", this.onWindowPointerRelease); |
| 1863 | window.addEventListener("pointercancel", this.onWindowPointerRelease); |
| 1846 | 1864 | } |
| 1847 | 1865 | |
| 1848 | 1866 | private removeEvents(): void { |
| ... | ... | @@ -1869,6 +1887,8 @@ export class GhosttyTerminalSurface { |
| 1869 | 1887 | this.scrollbar.removeEventListener("pointerup", this.onScrollbarPointerUp); |
| 1870 | 1888 | this.scrollbar.removeEventListener("pointercancel", this.onScrollbarPointerUp); |
| 1871 | 1889 | this.scrollbar.removeEventListener("keydown", this.onScrollbarKeyDown); |
| 1890 | window.removeEventListener("pointerup", this.onWindowPointerRelease); |
| 1891 | window.removeEventListener("pointercancel", this.onWindowPointerRelease); |
| 1872 | 1892 | } |
| 1873 | 1893 | |
| 1874 | 1894 | private scrollViewport(deltaRows: number): void { |