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
23 changes: 13 additions & 10 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@
"dist/"
],
"dependencies": {
"@opentui/core": "^0.1.81",
"ghostty-opentui": "^1.4.3"
"@opentui/core": "^0.1.88",
"ghostty-opentui": "^1.4.7"
},
"devDependencies": {
"@biomejs/biome": "^2.4.4",
"@commitlint/cli": "^20.4.2",
"@commitlint/config-conventional": "^20.4.2",
"@types/bun": "^1.3.9"
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
26 changes: 26 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/src/terminal-buffer.ts b/src/terminal-buffer.ts
index 818145199154a290083de72f87a69ecbc2acd167..5dac6238d07492af38da5412382472d8d670e1d1 100644
--- a/src/terminal-buffer.ts
+++ b/src/terminal-buffer.ts
@@ -585,7 +585,9 @@ export class GhosttyTerminalRenderable extends TextBufferRenderable {

// Update line count based on actual rendered lines
const lineInfo = this.textBufferView.logicalLineInfo
- this._lineCount = lineInfo.lineStarts.length
+ if (lineInfo) {
+ this._lineCount = lineInfo.lineStarts.length
+ }

this._ansiDirty = false
}
@@ -613,8 +615,8 @@ export class GhosttyTerminalRenderable extends TextBufferRenderable {
// Get the line info which contains actual Y offsets for each line
// This accounts for wrapping and actual text layout
const lineInfo = this.textBufferView.logicalLineInfo
- const lineStarts = lineInfo.lineStarts
-
+ const lineStarts = lineInfo?.lineStarts
+
// If we have line start info, use it; otherwise fall back to simple calculation
let lineYOffset = clampedLine
if (lineStarts && lineStarts.length > clampedLine) {
4 changes: 2 additions & 2 deletions src/utils/shutdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export function setupShutdownHandlers(app: App, logWriter?: LogWriter): void {
process.on('SIGTERM', shutdown)
process.on('uncaughtException', err => {
log('Uncaught exception:', err?.message ?? err)
process.stderr.write(`numux: unexpected error: ${err?.stack ?? err}\n`)
app.shutdown().finally(() => {
process.stderr.write(`numux: unexpected error: ${err?.stack ?? err}\n`)
logWriter?.cleanup()
process.exit(1)
})
Expand All @@ -33,8 +33,8 @@ export function setupShutdownHandlers(app: App, logWriter?: LogWriter): void {
process.on('unhandledRejection', (reason: unknown) => {
const message = reason instanceof Error ? reason.message : String(reason)
log('Unhandled rejection:', message)
process.stderr.write(`numux: unhandled rejection: ${message}\n`)
app.shutdown().finally(() => {
process.stderr.write(`numux: unhandled rejection: ${message}\n`)
logWriter?.cleanup()
process.exit(1)
})
Expand Down
Loading