Skip to content

Commit

Permalink
use PROMPT_COMMAND to make sure PS1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyaoww committed Nov 11, 2024
1 parent 4aeb681 commit 28615cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openhands/runtime/utils/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def __init__(self, work_dir: str, username: str | None = None):
self.pane = self.session.attached_window.attached_pane

# Configure bash to use simple PS1 and disable PS2
self.pane.send_keys(f'export PS1="{self.PS1}"; export PS2=""')
self.pane.send_keys(
f'export PROMPT_COMMAND=\'export PS1="{self.PS1}"\'; export PS2=""'
)
time.sleep(0.2) # Wait for command to take effect
self._clear_screen()

Expand Down

0 comments on commit 28615cd

Please sign in to comment.