Skip to content

Fix C-a jumping to stray prompt char in command output#464

Merged
dakra merged 1 commit into
mainfrom
fix-bol-stray-prompt-char
Jun 24, 2026
Merged

Fix C-a jumping to stray prompt char in command output#464
dakra merged 1 commit into
mainfrom
fix-bol-stray-prompt-char

Conversation

@dakra

@dakra dakra commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Two complementary fixes for ghostel-beginning-of-input-or-line:

  1. Cap the prompt-prefix scan at 60 columns in ghostel-prompt-regexp.
    Real prompts put their symbol near BOL; a prompt char found deep in
    a line (e.g. the % in a dnf "100%" progress line) is command output,
    not a prompt. Replace the unbounded [^…]* with [^…]{0,60} so the
    fallback regex cannot match past the first 60 columns.

  2. Suppress the regex fallback when OSC 133 is active and a real
    ghostel-prompt property exists after point. On a property-less
    output line that sits above a real prompt the regex is unreliable;
    prefer BOL. The check is directional (after point only) so inner
    REPLs and tmux/screen prompts — which are the live bottom line with
    no prompt below — are unaffected.

Closes #430

@dakra
dakra force-pushed the fix-bol-stray-prompt-char branch from 11c6952 to 322ac11 Compare June 24, 2026 13:49
Two complementary fixes for ghostel-beginning-of-input-or-line:

1. Cap the prompt-prefix scan at 60 columns in ghostel-prompt-regexp.
   Real prompts put their symbol near BOL; a prompt char found deep in
   a line (e.g. the % in a dnf "100%" progress line) is command output,
   not a prompt.  Replace the unbounded [^…]* with [^…]\{0,60\} so the
   fallback regex cannot match past the first 60 columns.

2. Suppress the regex fallback when OSC 133 is active and a real
   ghostel-prompt property exists after point.  On a property-less
   output line that sits above a real prompt the regex is unreliable;
   prefer BOL.  The check is directional (after point only) so inner
   REPLs and tmux/screen prompts — which are the live bottom line with
   no prompt below — are unaffected.

Closes #430
@dakra
dakra force-pushed the fix-bol-stray-prompt-char branch from 322ac11 to 962d1be Compare June 24, 2026 16:42
@dakra
dakra merged commit 962d1be into main Jun 24, 2026
24 checks passed
@dakra
dakra deleted the fix-bol-stray-prompt-char branch June 24, 2026 18:19
@dakra
dakra temporarily deployed to github-pages June 24, 2026 18:19 — with GitHub Actions Inactive
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.

C-a in copy/emacs mode stops mid-line on command output

1 participant