Skip to content

fix(fish): trigger prompt repaint when Enter is pressed with pager open#7462

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-omp-repaint-issue
Draft

fix(fish): trigger prompt repaint when Enter is pressed with pager open#7462
Copilot wants to merge 3 commits intomainfrom
copilot/fix-omp-repaint-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

When the fish completion pager is open and the user presses Enter to execute a command, OMP was not refreshing the prompt — leaving it stale (e.g. showing the old pwd after cd).

Root cause

_omp_enter_key_handler had an early-return path for paging mode that called execute and returned without setting _omp_new_prompt = 1. On the next fish_prompt call, OMP saw the flag as 0 and echoed the cached prompt unchanged.

# Before — missing prompt refresh in paging-mode path
function _omp_enter_key_handler
    if commandline --paging-mode
        commandline --function execute
        return  # _omp_new_prompt never set to 1
    end
    ...
end

Fix

The paging-mode branch now mirrors the normal execution path:

if commandline --paging-mode
    set --global _omp_new_prompt 1
    set --global _omp_tooltip_command ''
    _omp_cleanup_stream
    if test $_omp_transient_prompt = 1
        set --global _omp_transient 1
        commandline --function repaint
    end
    commandline --function execute
    return
end

This ensures tooltip state, streaming cleanup, transient prompt handling, and the repaint flag are all consistent regardless of whether execution was triggered from the pager.

Agent-Logs-Url: https://github.com/JanDeDobbeleer/oh-my-posh/sessions/85631a35-3415-43c1-819c-f13d73244cde

Co-authored-by: JanDeDobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 12, 2026 20:02
Copilot AI requested review from Copilot and removed request for Copilot April 12, 2026 20:03
Copilot AI changed the title [WIP] Fix OMP repaint issue with fish pager active fix(fish): trigger prompt repaint when Enter is pressed with pager open Apr 12, 2026
Copilot AI requested a review from JanDeDobbeleer April 12, 2026 20:03
@TheFurnace
Copy link
Copy Markdown

I built and tested this branch on my machine at it appears to resolve the issue. My repro steps from the original issue no longer cause the bug.

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.

OMP does not trigger repaint when command is submitted by enter key with fish pager open

3 participants