starship / starship

☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!
https://starship.rs
ISC License
49.36k stars 2.14k forks source link

Support OSH Shell (nearly identical to bash) #6686

Open Erudition opened 2 months ago

Erudition commented 2 months ago

Feature Request

Add support for osh (see https://oils.pub/). I've been using it with Starship and it works fine by thinking it's in bash. OSH is just a stricter, cleaner bash with better errors.

Is your feature request related to a problem? Please describe.

When using the shell module to indicate which shell I'm using, starship shows "bash" even though it's not. This is because I initialize it with eval "$(starship init bash)" in my oshrc file. Changing it to osh does not work.

bsh ❯ starship init osh
osh is not yet supported by starship.
For the time being, we support the following shells:
* bash
* elvish
* fish
* ion
* powershell
* tcsh
* zsh
* nu
* xonsh
* cmd

Please open an issue in the starship repo if you would like to see support for osh:
https://github.com/starship/starship/issues/new

Describe the solution you'd like

Add osh to the list.

Describe alternatives you've considered

Hacking the shell module to make it detect osh correctly?

babalolajnr commented 1 month ago

I would like to take this up if I can get some guidance on what I need to do to get this working.

davidkna commented 1 month ago

3277 should be the most recent PR that added a new shell and may be useful as a base. Bash and OSH can also likely use the same initialization file with specific specializations at runtime. In particular, OSH may be able to reuse the PS0 hook method. Furthermore please check any branches in the rust code specific to bash (e.g. ANSI wrapping), because they will need to be taken with OSH too.

babalolajnr commented 1 month ago

I actually opened that pull request but closed it because I realized I just added the OSH module without the whole shell initialization etc part. I am also very new to this domain so I am just trying to go off of the existing code for the other shells.