Giter Club home page Giter Club logo

Comments (6)

bakks avatar bakks commented on August 22, 2024

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.

from butterfish.

zach-is-my-name avatar zach-is-my-name commented on August 22, 2024

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?).

from butterfish.

DavidGamba avatar DavidGamba commented on August 22, 2024

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.

from butterfish.

bakks avatar bakks commented on August 22, 2024

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

from butterfish.

bakks avatar bakks commented on August 22, 2024

Added related commits:

Let me summarize what I've done:

  • By default, butterfish will append "๐Ÿ  " to your PS1, meaning it will show up on the command line at each prompt. You can execute with -p '' if you don't want anything appended, e.g. butterfish shell -p ''.
  • We now set BUTTERFISH_SHELL as an env var, so you can detect this in your .profile (or whatever shell config). If BUTTERFISH_SHELL is set then it will exit rather than wrapping the shell twice.
  • You can now run Status as a prompt, which will print out the current shell configuration, e.g. which models you're currently using.

I will package this in a new release soon!

from butterfish.

bakks avatar bakks commented on August 22, 2024

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

from butterfish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.