Skip to content

Hang when double-clicking a very long line #11177

Closed

Description

@mitchellh

Discussed in #11171

Originally posted by injust March 4, 2026

Issue Description

This output is a single long line from a basedpyright error. The terminal usually works normally, but hangs as soon as you double-click a word in the line. When I was trying to get logs, the terminal would sometimes hang without double-clicking, e.g. when I was scrolling or alt-tabbing.

It also hangs in the slow/fast debug builds, but doesn't crash.

Expected Behavior

Should not hang

Actual Behavior

Hangs

Reproduction Steps

  1. cat this file
  2. Double click any text in the output

Ghostty Logs

No response

Ghostty Version

Ghostty 1.3.0-main+2cfc9d36d

Version
  - version: 1.3.0-main+2cfc9d36d
  - channel: tip
Build Config
  - Zig version   : 0.15.2
  - build mode    : .ReleaseSafe
  - app runtime   : .none
  - font engine   : .coretext
  - renderer      : renderer.generic.Renderer(renderer.Metal)
  - libxev        : kqueue

OS Version Information

macOS Sequoia 15.7.4

Minimal Ghostty Configuration

# empty

Additional Relevant Configuration

No response

I acknowledge that:

  • I have reviewed the FAQ and confirm that my issue is NOT among them.
  • I have searched the Ghostty repository (both open and closed Discussions and Issues) and confirm this is not a duplicate of an existing issue or discussion.
  • I have checked the "Preview" tab on all text fields to ensure that everything looks right, and have wrapped all configuration and code in code blocks with a group of three backticks (```) on separate lines.

Activity

  1. added this to the 1.3.0 milestone on Mar 5, 2026
  2. added theissue type on Mar 5, 2026
  3. mitchellh commented on Mar 5, 2026

    @mitchellh
    ContributorAuthor
    Thread 1 Queue : com.apple.main-thread (serial)
    #0	0x000000010aa5250c in onigenc_step_back at /Users/mitchellh/.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regenc.c:210
    #1	0x000000010aa2885c in match_at at /Users/mitchellh/.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regexec.c:4257
    #2	0x000000010aa3aa20 in search_in_range at /Users/mitchellh/.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regexec.c:5657
    #3	0x000000010aa36df4 in onig_search at /Users/mitchellh/.cache/zig/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c/src/regexec.c:5414
    #4	0x000000010bd76300 in regex.Regex.searchAdvanced at /Users/mitchellh/Documents/ghostty/pkg/oniguruma/regex.zig:67
    #5	0x000000010bd76444 in regex.Regex.search at /Users/mitchellh/Documents/ghostty/pkg/oniguruma/regex.zig:54
    #6	0x000000010bd766c0 in terminal.StringMap.SearchIterator.next at /Users/mitchellh/Documents/ghostty/src/terminal/StringMap.zig:47
    #7	0x000000010bd76e18 in Surface.linkAtPin at /Users/mitchellh/Documents/ghostty/src/Surface.zig:4462
    #8	0x000000010c0dee74 in Surface.mouseButtonCallback at /Users/mitchellh/Documents/ghostty/src/Surface.zig:4118
    #9	0x000000010c0d8c24 in apprt.embedded.Surface.mouseButtonCallback at /Users/mitchellh/Documents/ghostty/src/apprt/embedded.zig:815
    #10	0x000000010c0d8b9c in apprt.embedded.CAPI.ghostty_surface_mouse_button at /Users/mitchellh/Documents/ghostty/src/apprt/embedded.zig:1819
    #11	0x000000010a5687e4 in Ghostty.SurfaceView.mouseDown(with:) at /Users/mitchellh/Documents/ghostty/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift:863
    #12	0x000000010a568850 in @objc Ghostty.SurfaceView.mouseDown(with:) ()
    #13	0x0000000186b53af8 in -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] ()
    #14	0x0000000186b50970 in -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] ()
    #15	0x0000000186b50400 in -[NSWindow(NSEventRouting) sendEvent:] ()
    #16	0x000000010a403a64 in TerminalWindow.sendEvent(_:) at /Users/mitchellh/Documents/ghostty/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift:188
    #17	0x000000010a403acc in @objc TerminalWindow.sendEvent(_:) ()
    #18	0x000000010a417320 in TitlebarTabsTahoeTerminalWindow.sendEvent(_:) at /Users/mitchellh/Documents/ghostty/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift:75
    #19	0x000000010a417388 in @objc TitlebarTabsTahoeTerminalWindow.sendEvent(_:) ()
    #20	0x00000001868889e0 in -[NSApplication(NSEventRouting) sendEvent:] ()
    #21	0x0000000186320bac in -[NSApplication _handleEvent:] ()
    #22	0x0000000185dbb7a8 in -[NSApplication run] ()
    #23	0x0000000185da76dc in NSApplicationMain ()
    #24	0x000000010a2f4fd4 in main at /Users/mitchellh/Documents/ghostty/macos/Sources/App/macOS/main.swift:33
    #25	0x0000000181541d54 in start ()
    
  4. jcollie commented on Mar 5, 2026

    @jcollie
    Member

    Perhaps some pathological case for the file path detection regex?

    CC: @bkircher

  5. mitchellh commented on Mar 5, 2026

    @mitchellh
    ContributorAuthor

    Yeah it is, I've got a fix coming which is a band-aid which is just capping Oni retries to avoid the hang, but a more robust regex fix would be better. I'll still close this out though since a realistic URL is never going to hit this. Coming soon.

  6. self-assigned this
    on Mar 5, 2026
  7. added a commit that references this issue on Mar 5, 2026
    fe1e25f
  8. added 2 commits that reference this issue on Mar 5, 2026
    7b8c57c
    96411c6
  9. added a commit that references this issue on Mar 10, 2026
    1dd0c81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions