Skip to content

Instantly share code, notes, and snippets.

@runlevel5
Last active September 17, 2025 13:21
Show Gist options
  • Save runlevel5/8fe3431663c38a0aaffef126dda2780f to your computer and use it in GitHub Desktop.
Save runlevel5/8fe3431663c38a0aaffef126dda2780f to your computer and use it in GitHub Desktop.

Revisions

  1. runlevel5 revised this gist Sep 17, 2025. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions fish_toolbx.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,9 @@ if status is-interactive
    echo -n -e "\n⬢ "
    set_color normal
    echo -n "["(whoami)"@"(hostname)"$TOOLBOX_NAME "(prompt_pwd)"]\$ "
    else
    set_color normal
    echo -n "["(whoami)"@"(hostname)" "(prompt_pwd)"]\$ "
    end
    end
    end
  2. runlevel5 created this gist Sep 17, 2025.
    23 changes: 23 additions & 0 deletions fish_toolbx.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    So if you happen to use fish shell for your toolbox container environment, you should set the fish_prompt by modify `~/.config/fish/config.fish`:

    ```
    if status is-interactive
    # Commands to run in interactive sessions can go here
    function is_toolbox
    if test -f /run/.toolboxenv
    set toolbox_name (grep -E '^name="' /run/.containerenv | cut -d \" -f 2)
    echo " ❱ $toolbox_name"
    end
    end
    set TOOLBOX_NAME (is_toolbox)
    function fish_prompt
    if test -n "$TOOLBOX_NAME"
    set_color magenta
    echo -n -e "\n⬢ "
    set_color normal
    echo -n "["(whoami)"@"(hostname)"$TOOLBOX_NAME "(prompt_pwd)"]\$ "
    end
    end
    end
    ```