Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add zsh and dash support to prompt #32

Merged
merged 7 commits into from
Dec 17, 2019
Merged

feat: add zsh and dash support to prompt #32

merged 7 commits into from
Dec 17, 2019

Conversation

dmccaffery
Copy link
Member

@dmccaffery dmccaffery commented Nov 17, 2019

  • restructure prompt repository to allow switching shells between:
    • sh/dash
    • bash
    • zsh
  • move most scripts that are shell agnostic to sh and update shebang
  • maintain feature parity between bash / zsh for:
    • prompt
    • color support
    • shell options
    • tab completion (including case-insensitive secondary match)
  • update documentation for updated installation
  • add use-bash command to enable changing the default shell to bash
  • add use-zsh command to enable changing the default shell to zsh
  • add dark-mode theme for macOS
  • add support for installing older versions of prompt through bootstrap and update-prompt commands

NOTES:

Adding support for zsh allows new installations of macOS Catalina to
use the default shell, which was switched to zsh for this release.
Future builds of macOS are likely to drop built-in support for bash due
to the GPLv3 license.

When bootstrapping prompt from bash; prompt will update and use bash.
When bootstrapping prompt from zsh; prompt will update and use zsh.
When bootstrapping from any other shell, prompt will use bash by default.

A command line argument can be used to to select the prompt at install time.
Switching prompts can be done via new use-bash and use-zsh commands.

BREAKING CHANGE:

While this is not an actual breaking change, quite a bit has changed with
regard to how prompt actually works. We want to notify users that this may
result is some level of bugs as test coverage of scripts like this one is
incredibly difficult.

@dmccaffery dmccaffery requested a review from sjk07 as a code owner November 17, 2019 18:36
@dmccaffery dmccaffery self-assigned this Nov 17, 2019
@sjk07
Copy link
Member

sjk07 commented Nov 18, 2019

@dmccaffery sweet stuff! But, all of linux has broken! 😭
Can we get these tests passing again?

@dmccaffery
Copy link
Member Author

@sjk07 I noticed the docker tests were failing and was hoping you might help take a look; I looked at it and if you comment out the smoke test lines, then build the container, then run with docker -it <SHA> the exact same line you commented out; it works flawlessly.

It has something to do with the $SHELL variable not being respected from the environment from the previous docker layer. I tried using the SHELL directive in the Dockerfile, but that doesn’t help either.

Ultimately; everything works in real-world testing — it’s just failing in docker.

Maybe hardcoding the path to the shell location in the smoke test? /home/linuxbrew/.linuxbrew/bin/zsh for example? That defeats the point of proving that the chsh fires (although I know it does).

@dmccaffery
Copy link
Member Author

You can easily build the containers using:

./docker/build.sh # build everything

OR

./docker/build.sh centos # build a specific platform

Copy link
Member

@sjk07 sjk07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm; looking into this

LOL

@dmccaffery
Copy link
Member Author

HOLD: should enable bootstrap / install of a specific version of prompt just in case this big change causes any issues for folks.

@sjk07
Copy link
Member

sjk07 commented Nov 26, 2019

@dmccaffery Should we make upgrading major versions optional with an easy rollback strategy if things mess up?

EDIT:
I know we have the backup folder. just thinking of a more automated way to keep things easy for the user

dmccaffery and others added 5 commits December 12, 2019 18:39
* restructure prompt repository to allow switching shells between:
  * sh/dash
  * bash
  * zsh
* move most scripts that are shell agnostic to sh and update shebang
* maintain feature parity between bash / zsh for:
  * prompt
  * color support
  * shell options
  * tab completion (including case-insensitive secondary match)
* update documentation for updated installation
* add `use-bash` command to enable changing the default shell to bash
* add `use-zsh` command to enable changing the default shell to zsh
* add a new dark mode theme for darwin
* add support for installing older versions of prompt from bootstrap and
  `update-prompt` command

NOTES:

Adding support for zsh allows new installations of macOS Catalina to
use the default shell, which was switched to zsh for this release.
Future builds of macOS are likely to drop built-in support for bash due
to the GPLv3 license.

When bootstrapping prompt from bash; prompt will update and use bash.
When bootstrapping prompt from zsh; prompt will update and use zsh.
When bootstrapping from any other shell, prompt will use bash by default.

A command line argument can be used to to select the prompt at install time.
Switching prompts can be done via new `use-bash` and `use-zsh` commands.

BREAKING CHANGE:

While this is not an actual breaking change, quite a bit has changed with
regard to how prompt actually works. We want to notify users that this may
result is some level of bugs as test coverage of scripts like this one is
incredibly difficult.
@dmccaffery
Copy link
Member Author

@sjk07 -- I think I got the builds all fixed (will see if they pass in a few minutes) -- also added support for installing a specific version of prompt, both through bootstrapping and/or update-prompt commands -- this is a viable fallback strategy should something completely explode for some reason.

@dmccaffery dmccaffery requested a review from sjk07 December 12, 2019 19:03
Copy link
Member

@sjk07 sjk07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM FINALLY!

@dmccaffery dmccaffery merged commit 275f62c into automotiveMastermind:master Dec 17, 2019
@dmccaffery dmccaffery deleted the add-zsh branch December 17, 2019 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants