Skip to content

Sometimes ^H appears in front of the prompt #4844

@egmontkob

Description

@egmontkob

Is there an existing issue for this?

  • I have searched the existing issues

Midnight Commander version and build configuration

- 4.8.33
- 4.8.33-402-g723392f61

Operating system

Ubuntu 25.10

Is this issue reproducible using the latest version of Midnight Commander?

  • I confirm the issue is still reproducible with the latest version of Midnight Commander

How to reproduce

Create a shell prompt that executes slowly, e.g. place this in ~/.bashrc:

PS1='$(sleep 1)'"$PS1"

Start up mc. (Wait patiently, it feeds a multi-line init string to the subshell causing multiple prompts.)

Press Ctrl-O to hide the panels.

Expected behavior

Subshell prompt should appear as normal.

Actual behavior

^H (space, caret, H) is displayed in front of the prompt.

Additional context

src/subshell/common.c has this:

write_all (mc_global.tty.subshell_pty, " \b", 2);  // Hack to make prompt reappear

Apparently this is sent when the tty line is still in cooked mode, and the kernel echoes it back in caret-notation.

Not sure if we can find a better hack instead. Nor is it clear to me why it would necessarily trigger a prompt repaint in the shell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues not related to a specific subsystemprio: mediumHas the potential to affect progress

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions