Skip to content

OSC 133 shell integration is missing start of command execution #7376

@heaths

Description

@heaths

#3842 does not write FTCS_COMMAND_EXECUTED, which is used at least by Ghostty (terminal) to calculate command execution timing.

I was able to repro this by disabling shell_integration in OMP and then writing the terminal sequences myself with and without the \033]133;C\007 mark. Seems some other terminals don't need this, but to calculate command execution time by the terminal outside of OMP, terminals like Ghostty would need this. If it merely used \033]133;B\007 - FTCS_COMMAND_START - the execution time would be useless because the user could've been sitting at the prompt for minutes or even days. OMP should write FTCS_COMMAND_EXECUTED for terminals to properly measure execution time.

I'm having a similar issue in Ghostty. shell_integration: true is set in my theme and works in bash 5.3.9(1)-release (aarch64-apple-darwin25.1.0) but not in pwsh 7.5.4. If I emit the following in pwsh myself it does work in Ghostty:

"`e]133;C`a"; sleep 11; "`e]133;D;0`a"

My Ghostty config:

notify-on-command-finish = unfocused
notify-on-command-finish-action = bell,notify
notify-on-command-finish-after = 10s

Though, I'm not sure if it is OMP. In pwsh running the following does show the OSC 133 markers:

PS> oh-my-posh print primary -c ~/.config/oh-my-posh/theme.omp.yml --shell pwsh --plain | more
ESC]133;D;0^GESC]133;A^G PS <U+E0B0> ESC]8;;file:/Users/heathsESC\~ESC]8;;ESC\ > <U+E0B0>
 <U+E0A0> main ≡ <U+F044> ~2 <U+E0B0> ESC]133;B^G

Originally posted by @heaths in #6090 (reply in thread)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions