Deprecate $_ in favor of (status current-command)

Closes #813.
This commit is contained in:
Mahmoud Al-Qudsi
2018-03-24 11:58:19 -05:00
parent 6d80ab8d74
commit 515fc509ec
6 changed files with 21 additions and 8 deletions

View File

@@ -1297,14 +1297,14 @@ To customize the syntax highlighting, you can set the environment variables list
\subsection title Programmable title
When using most virtual terminals, it is possible to set the message displayed in the titlebar of the terminal window. This can be done automatically in fish by defining the `fish_title` function. The `fish_title` function is executed before and after a new command is executed or put into the foreground and the output is used as a titlebar message. The $_ environment variable will always contain the name of the job to be put into the foreground (Or 'fish' if control is returning to the shell) when the `fish_prompt` function is called. The first argument to fish_title will contain the most recently executed foreground command as a string, starting with fish 2.2.
When using most virtual terminals, it is possible to set the message displayed in the titlebar of the terminal window. This can be done automatically in fish by defining the `fish_title` function. The `fish_title` function is executed before and after a new command is executed or put into the foreground and the output is used as a titlebar message. The `status current-command` builtin will always return the name of the job to be put into the foreground (or 'fish' if control is returning to the shell) when the `fish_prompt` function is called. The first argument to fish_title will contain the most recently executed foreground command as a string, starting with fish 2.2.
Examples:
The default `fish` title is
\fish
function fish_title
echo $_ ' '
echo (status current-command) ' '
pwd
end
\endfish