Bash: PS2 is not overridden a la PS1

Open
#2,671 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
bash
Domain
cli

Research direction

Reproduce the issue in a Bash session using ~/.bash_profile with a custom PS2, then trace where Warp overrides PS1 and how the custom-prompt setting is applied. Done means PS2 is overridden consistently with PS1 when custom prompts are disabled, while the user's PS2 remains honored when that setting is enabled.

Written by the indexing model from the issue text.

Description

area:shell-terminal bug needs-info ready-to-implement triaged
Discord username (optional)

Skaak#0007

Describe the bug

Warp automatically overrides the user's PS1 setting in a bash shell (unless told to otherwise in the settings), but it does not override the user's PS2 setting. Depending on the PS2 setting, this can lead to unexpected behavior.

To Reproduce
  1. Ensure Warp's Features => Honor user's custom prompt is disabled

    Screenshot 2023-02-18 at 8 10 23 AM
  2. Edit ~/.bash_profile and add a PS2 with some nonsense in it; e.g.:

    export PS2="¯\\_(ツ)_/¯ "
    
  3. Open a new Warp window to refresh the bash session.

  4. Type the following (don't copy/paste!):

    if true; then
    echo "PS2 shown"
    fi
    
  5. You will see your custom PS2 (and the font will likely change):

    Screenshot 2023-02-18 at 8 18 30 AM
Expected behaviour

Warp should override the PS2 similarly to how it handles PS1 unless the user has chosen to use their custom prompt when using bash.

Screenshots

No response

Operating System

MacOS

OS Version

13.2.1

Shell Version

GNU bash, version 5.2.15(1)-release (aarch64-apple-darwin22.1.0)

Warp Version

v0.2023.02.14.08.05.stable_01

Additional context

No response

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

Dominant language
Rust
Stars
65.1k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from warpdotdev/warp

All issues in warpdotdev/warp

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.