-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
init: Update mapset and simplify shell prompts #923
Conversation
wenzeslaus
commented
Aug 21, 2020
- Updates mapset also for bash (already done for tcsh and zsh).
- Removes GRASS GIS version from the prompt (already in the welcome text).
- Removes w/W from PS1 in the default/fallback shell setup (not supported by POSIX or sh).
- Removes location (name) from PS1 in the default/fallback shell setup (making no assumptions on what is supported).
- Uses W instead of w (i.e., current directory name, not path) for Bash to make the prompt shorter.
- Adds /mapset (name) after the location (name) for Bash and removes quotes around it (saves two characters, possibly less cluttered).
- Remove obsolete and outdated LOCATION variable defined in shell (MAPSET_PATH already available as a replacement).
- Make prompts more similar to each other.
* Updates mapset also for bash (already done for tcsh and zsh). * Removes GRASS GIS version from the prompt (already in the welcome text). * Removes w/W from PS1 in the default/fallback shell setup (not supported by POSIX or sh). * Removes location (name) from PS1 in the default/fallback shell setup (making no assumptions on what is supported). * Uses W instead of w (i.e., current directory name, not path) for Bash to make the prompt shorter. * Adds /mapset (name) after the location (name) for Bash and removes quotes around it (saves two characters, possibly less cluttered). * Remove obsolete and outdated LOCATION variable defined in shell (MAPSET_PATH already available as a replacement). * Make prompts more similar to each other.
|
Here are the different prompts: bashzshtcshsh (fallback)Feel free to suggest changes. For example, I actually prefer to see full path, not just current directory name, but I think it is a good trade-off to have more space for location/mapset and the actual command. I focused on updating Bash now and just keeping the rest in sync. @nilason recently updated tcsh and added zsh. I think generally the prompts should be in sync in regard to e.g. showing the version number, but they can differ based on shell capabilities or common practices user of a given shell are used to. |
|
Here are different interactive shells with their welcome messages and prompts. (The welcome messages are just for context. This PR is only changing prompts.) bash on Ubuntuzsh defaulttcsh on Ubuntupythonipythonpipenv shell with Bash on UbuntuRoctavenodejsirb (Interactive Ruby) |
|
Tested and solves #921. I like the prompt changes, too 👍 |
I like that, but let's leave modernization with colors and unicode (:ear_of_rice: :seedling: ?) to another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are good and reasonable changes. I was considering dropping version from prompt with the addition of zsh, but left it as was at that time. It only takes up space. With the addition of mapset to bash, current directory only (as opposed to full path) is a good trade-off. Not difficult to pwd if one got lost.
Successfully tested with both bash and zsh.
