mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-26 07:41:15 -03:00
Add a "prompt_login" helper function
This prints a description of the "host". Currently that's `(chroot:debianchroot) $USER@$hostname` with the chroot part when needed. This also switches the default and terlar prompts to use it, the other prompts have slightly different coloring or logic here.
This commit is contained in:
26
doc_src/cmds/prompt_login.rst
Normal file
26
doc_src/cmds/prompt_login.rst
Normal file
@@ -0,0 +1,26 @@
|
||||
.. _cmd-prompt_login:
|
||||
|
||||
prompt_login - describe the login suitable for prompt
|
||||
=====================================================
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
echo -n (prompt_login) (prompt_pwd) '$ '
|
||||
end
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``prompt_login`` is a function to describe the current login. It will show the user, the host and also whether the shell is running in a chroot (currently debian's debian_chroot is supported).
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
>_ prompt_login
|
||||
root@bananablaster
|
||||
Reference in New Issue
Block a user