board/common: let Bash update its PS1 hostname for each new line

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-04-27 09:59:35 +02:00
committed by Tobias Waldekranz
parent 05d49f6cfc
commit 2272b56618
+7
View File
@@ -3,6 +3,13 @@
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Reevaluate for each line, in case hostname changes
function prompt_command
{
PS1="\u@$(hostname):\w\$ "
}
export PROMPT_COMMAND=prompt_command
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize