When changing the hostname and committing the changes, the shell prompt doesn't update immediately to reflect the new hostname. The prompt only changes after re-login. This behavior is particularly inconvenient in test and educational environments (like GNS3) where frequent hostname changes occur.
Steps to Reproduce:
- Connect to VyOS CLI
- Note current prompt (e.g., vyos@oldhostname:~$)
- Execute: set system host-name newhostname
- Execute: commit
- Observe the prompt remains with the old hostname
Expected Behavior:
The shell prompt should update immediately after commit to show the new hostname (e.g., vyos@newhostname:~$) without requiring re-login.
Actual Behavior:
The prompt continues to show the old hostname until the user re-logs in.
Suggested Solution:
- Update the prompt immediately after hostname change commit by refreshing the PS1 variable or triggering a prompt update mechanism.