Skip to content

Shell hangs on init when an alias contains a literal ESC byte (\x1b) #8755

@nflx

Description

@nflx

Description

Warp hangs during shell initialization if any alias in ~/.bashrc (or other rc files) contains a literal ESC byte (\x1b, visible as ^[ in cat -A).

Root Cause

Warp collects all shell aliases at bootstrap time (via alias) and encodes them into a DCS/OSC terminal escape sequence to send metadata to the UI (warp_bootstrapped). A raw \x1b byte inside that sequence terminates it prematurely, corrupting the entire bootstrap — causing it to loop and echo interactively rather than initialize silently.

Steps to Reproduce

  1. Add an alias to ~/.bashrc that contains a literal ESC byte, e.g. via copy-paste from a terminal. Example (the ^[ below is a real ESC byte, not the two characters \ and [):
    alias gls="git log --pretty=short|egrep -v '^(^[\[[0-9;]*m|^[\[m )+$'"
  2. Open a new Warp tab.
  3. Warp hangs — the bootstrap script is echoed at the interactive prompt repeatedly instead of initializing silently.

Expected Behavior

Warp should either:

  • Handle raw ESC bytes in alias output gracefully (strip or hex-encode them before embedding in escape sequences), or
  • Detect the problematic alias and emit a warning pointing to the culprit

Actual Behavior

Warp hangs indefinitely. The bootstrap content is echoed as interactive shell input with > continuation prompts, repeating in a loop. There is no error message or indication of the cause.

Workaround

Replace literal ESC bytes in aliases with \e (supported by GNU egrep/grep):

alias gls="git log --pretty=short|egrep -v '^(\\e\\[[0-9;]*m|\\e\\[m )+\$'"

Notes

  • This is very hard to diagnose because the alias definition looks correct when viewed in a text editor (the ESC byte is invisible), and the failure mode gives no useful signal about the root cause.
  • Diagnosing required binary-searching ~/.bashrc with temporary return statements, then using cat -A to reveal the hidden byte on the identified line.
  • The issue is not listed in the known issues / incompatible tools documentation.

Environment

  • OS: Ubuntu Linux 6.8.0
  • Shell: bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions