Skip to content

Fix rename type assertion, find regex handling, and scroll comments#7

Merged
onesuper merged 2 commits into
onesuper:mainfrom
hobostay:fix/session-bugs
Apr 11, 2026
Merged

Fix rename type assertion, find regex handling, and scroll comments#7
onesuper merged 2 commits into
onesuper:mainfrom
hobostay:fix/session-bugs

Conversation

@hobostay

Copy link
Copy Markdown

Summary

  • Remove unnecessary (this as any) type assertion in rename()label is already a public class property, no type cast needed
  • Add try/catch around RegExp construction in find() to gracefully return empty matches for invalid regex patterns instead of throwing an unhandled error
  • Remove dead code in wait() — the listener filter typeof l === "function" was always true since all listeners are functions; notifyListeners() already clears the array on each notification
  • Fix scroll direction comments to match xterm.js scrollLines() semantics: positive = scroll down (view newer content), negative = scroll up (view older content)

Test plan

  • All 35 existing tests pass (vitest run)
  • TypeScript compilation passes (tsc --noEmit)

🤖 Generated with Claude Code

- Remove unnecessary (this as any) type assertion in rename() —
  label is already declared as a public property
- Add try/catch around RegExp construction in find() to gracefully
  handle invalid regex patterns instead of throwing
- Remove dead code in wait() — the listener filter
  `typeof l === "function"` was always true since all listeners are
  functions; notifyListeners() already clears the array
- Fix scroll direction comments to match xterm.js scrollLines()
  semantics (positive=down/newer, negative=up/older)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@onesuper

Copy link
Copy Markdown
Owner

Nice, clean fixes — each one is exactly right. Thanks for taking the time to read the code carefully.

@onesuper onesuper merged commit d1080cc into onesuper:main Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants