Timeline for Show only current and parent directory in bash prompt
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 5, 2021 at 17:55 | comment | added | datalifenyc | Solutions using PowerShell can be found here: Configure Windows PowerShell to display only the current folder name in the shell prompt. Example provide by @Jelgab: Function Prompt { "$( ( get-item $pwd ).Name )>" } | |
| Jun 5, 2021 at 15:53 | comment | added | datalifenyc | Has anyone been able to develop a similar solution for Windows Command Prompt and/or PowerShell? When I use for %I in (.) do prompt %~nxI$G, the current folder is displayed, but it is not dynamic. So, it won't change when I change folders. Reference: Get current folder name by a DOS command? | |
| Nov 10, 2017 at 18:14 | comment | added | ezrock | Any ideas for cleaning up the output when navigating to /? As written, you get /// $ | |
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot | replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/ | |
| Jul 8, 2016 at 20:36 | comment | added | twalbaum | Thank you for bringing me back to this. Quoted the $PWDs to allow for spaces and included the final command. My current prompt is more complex than this, therefore the need for the prompt_command definition. Otherwise, PS1=... works on its on. | |
| Jul 8, 2016 at 20:33 | history | edited | twalbaum | CC BY-SA 3.0 | Quoted PWDs to allow for directories with spaces and added final missing command |
| Jun 21, 2016 at 12:37 | comment | added | LarsH | Also, this command fails when $PWD contains a space. | |
| Jun 21, 2016 at 12:27 | comment | added | LarsH | Is defining prompt_command() supposed to do something, on its own? It doesn't for me. Did you mean to also use prompt_command() in redefinitions of cd & co, like Gilles did? Or did you mean PROMPT_COMMAND='...'? | |
| Jul 21, 2015 at 0:23 | vote | accept | twalbaum | ||
| Oct 28, 2016 at 16:24 | |||||
| Jul 21, 2015 at 0:23 | history | edited | twalbaum | CC BY-SA 3.0 | deleted 7 characters in body |
| Jul 19, 2015 at 22:01 | history | answered | twalbaum | CC BY-SA 3.0 |