-
Notifications
You must be signed in to change notification settings - Fork 624
Description
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
- Add an alias to
~/.bashrcthat 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 )+$'"
- Open a new Warp tab.
- 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
~/.bashrcwith temporaryreturnstatements, then usingcat -Ato 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