- Download the
prompt.nu
file to the~/.config/nushell
directory. - Run
config nu
and add the following content to the configuration file.source ~/.config/nushell/prompt.nu let-env PROMPT_INDICATOR = {|| "" } let-env PROMPT_COMMAND = {|| full-left-prompt }
- Save the file and restart Nushell.
Modify the content as follows:
- Sequential execution of custom options
let-env PROMPT_COMMAND = {|| left-prompt [ 'user', 'dir', 'fast-git' 'duration', ]}
- Parallel execution of custom options. Currently, there is no significant difference in performance.
let-env PROMPT_COMMAND = {|| par-left-prompt [ 'user-host', 'dir', 'full-git' 'duration', ]}
[
'user', # Only display user name. Always hide the hostname
'user-host', # Automatically display the hostname when using SSH remote login.
'dir', # Display Current directory
'full-git' # More comprehensive Git information, including stage status.
'fast-git' # Faster Git information, with less information compared to full-git, suitable for Windows systems.
# You can also choose neither of them.
'duration', # Command execution time.
'wsl', # WSL environment indicator
]