Skip to content

Double-click in the terminal selects the whole path before the word #858

Description

@ivan-leschinsky

What happened?

In a Supacode terminal, double-clicking a word that follows a path on the same line selects the path too, instead of just the word.

With a powerlevel10k prompt, the line looks like this:

~/work/nas/lxc_sidestore master

Double-clicking master selects ~/work/nas/lxc_sidestore master. I expected the selection to stop at the space, which is what selection-word-chars says (space is a word boundary in the default value, and Supacode does not override it). Without a path on the line the same double-click selects just the word, so the space is not the problem: the path is.

The cause is upstream, not in Supacode's own code. Ghostty's link/path detection runs before word selection and overrides selection-word-chars, so anything Ghostty thinks might be a path or URL swallows the following words. It is a regression between ghostty v1.2.3 and v1.3.0, discussed in ghostty-org/ghostty#11404 and ghostty-org/ghostty#11415, and fixed upstream by ghostty-org/ghostty#12435 ("surface: respect semantic prompt boundaries for links"), merged 2026-04-25.

Supacode pins ThirdParty/ghostty at 6057f8d (2026-03-26), which predates the fix, and no ghostty release carries it either: the newest tag, v1.3.1, is from 2026-03-13. So the only way to get the fix is a submodule bump.

I have a bump ready that keeps the toolchain untouched: 74d0c72 (2026-07-20) is the last main commit before ghostty requires Zig 0.16.0, so mise.toml keeps zig = "0.15.2". Two of the four patches in patches/ghostty/ need refreshing against it; the other two only move by line offsets. Happy to open it once this is marked ready.

Steps to reproduce

  1. Use a shell prompt that puts a path before another segment on the same line. A powerlevel10k lean prompt does this by default: ~/w/t/dir master.
  2. Double-click the branch name at the end of the prompt.
  3. The whole ~/w/t/dir master gets selected instead of just master.

Without a custom prompt:

  1. Run echo "/bin/a -b -c" in a Supacode terminal.
  2. Double-click -b in the output.
  3. The whole /bin/a -b -c gets selected.

Supacode version and build

0.10.8 (1785775286)

macOS version

macOS 26.5.2

System locale

ru_BY

Mac hardware

M4 Max

Are you planning to fix this yourself?

  • I intend to open a pull request once this is confirmed and marked ready.

Before submitting

  • I searched existing issues and this is not a duplicate.
  • I am on the latest available version of Supacode.
  • I understand pull requests are closed until the issue is marked ready.
  • I agree to follow this project's Code of Conduct.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions