diff --git a/nix/devshell.nix b/nix/devshell.nix index 9f8aa09f7..1ccc0898e 100644 --- a/nix/devshell.nix +++ b/nix/devshell.nix @@ -1,5 +1,6 @@ { mkShell, lib, stdenv +, bashInteractive , debugedit , flatpak-builder , gdb @@ -85,6 +86,10 @@ in mkShell rec { wabt wasmtime ] ++ lib.optionals stdenv.isLinux [ + # My nix shell environment installs the non-interactive version + # by default so we have to include this. + bashInteractive + # Flatpak builds debugedit flatpak-builder diff --git a/src/shell-integration/bash/ghostty.bash b/src/shell-integration/bash/ghostty.bash index 7ac5828d3..b8a7e3d8c 100644 --- a/src/shell-integration/bash/ghostty.bash +++ b/src/shell-integration/bash/ghostty.bash @@ -32,23 +32,24 @@ function __ghostty_get_current_command() { function __ghostty_precmd() { local ret="$?" if test "$_ghostty_executing" != "0"; then + _GHOSTTY_SAVE_PS0="$PS0" _GHOSTTY_SAVE_PS1="$PS1" _GHOSTTY_SAVE_PS2="$PS2" # Marks - PS1=$PS1'\e]133;B\a' - PS2=$PS2'\e]133;B\a' + PS1=$PS1'\[\e]133;B\a\]' + PS2=$PS2'\[\e]133;B\a\]' # Cursor - PS1=$PS1'\e[5 q' - PS0=$PS0'\e[0 q' + PS1=$PS1'\[\e[5 q\]' + PS0=$PS0'\[\e[0 q\]' # Command PS0=$PS0'$(__ghostty_get_current_command)' - PS1=$PS1'\e]2;$PWD\a' + PS1=$PS1'\[\e]2;$PWD\a\]' fi - if test "$_ghostty_executing" != ""; then + if test "$_ghostty_executing" != "0"; then builtin printf "\033]133;D;%s;aid=%s\007" "$ret" "$BASHPID" fi @@ -65,6 +66,7 @@ function __ghostty_precmd() { } function __ghostty_preexec() { + PS0="$_GHOSTTY_SAVE_PS0" PS1="$_GHOSTTY_SAVE_PS1" PS2="$_GHOSTTY_SAVE_PS2" builtin printf "\033]133;C;\007"