bakks / butterfish

A shell with AI superpowers
https://butterfi.sh
MIT License
294 stars 24 forks source link

Would be nice to have some kind of indicator that you're in shell mode, Or... #2

Closed zach-is-my-name closed 1 year ago

zach-is-my-name commented 1 year ago

...at least a quick way to query if you're in shell mode

bakks commented 1 year ago

I was thinking this as well - I was considering replacing the shell prompt (e.g. the > or $) with an indicator, maybe 🐠 for fun. Is that the kind of thing you're thinking of? Open to suggestions here.

zach-is-my-name commented 1 year ago

I think it's a great idea. You can actually change my shell prompt from your go binary? That's beyond cool!

I think if they're going to run your wrapped shell you pretty much have license to manipulate anybody's prompt, I'd just want to preserve my current path inside it (mostly every prompt has this today right?).

DavidGamba commented 1 year ago

I would want to control my prompt myself. Maybe you can offer the bash or zsh functions that the user can include in their brash prompt if they so choose.

The way I do it is the following:

function butterfish_shell {
    [[ $BUTTERFISH_SHELL == "true" ]] && echo -ne " 🐠 "
}

    local FIRST_LINE="......  \${K8S_CONTEXT} \$(butterfish_shell)"
    PS1=${TERM_RESET}${PS1_START_MARK}${TERM_TITLE}${FIRST_LINE}${SECOND_LINE}${REGULAR_TEXT}${COMMAND_START_MARK}

Then start butterfish with BUTTERFISH_SHELL=true butterfish shell

If anything, a standard env var that butterfish sets itself would make my config more generic.

bakks commented 1 year ago

Ahh, @DavidGamba a standard env var is a great idea. This is a helpful discussion, I will play around and get something working.

bakks commented 1 year ago

Added related commits:

Let me summarize what I've done:

I will package this in a new release soon!

bakks commented 1 year ago

This is released in v0.0.31, please update and let me know what you think!