nushell: show remote host in title

This commit is contained in:
2025-12-08 01:53:10 -05:00
parent 1e547070f7
commit b17760b54a

View File

@@ -1,6 +1,17 @@
# Disable welcome message per https://www.nushell.sh/book/configuration.html#remove-welcome-message # Disable welcome message per https://www.nushell.sh/book/configuration.html#remove-welcome-message
$env.config.show_banner = false $env.config.show_banner = false
# Configure window title with SSH hostname prefix
$env.config.hooks.pre_prompt = [{
let title_prefix = if "SSH_CONNECTION" in $env {
$"[(sys host | get hostname)] "
} else {
""
}
print -n $"(ansi title)($title_prefix)(pwd | str replace $env.HOME "~")(ansi st)"
}]
# Set theme # Set theme
source ($nu.default-config-dir | path join "themes/catppuccin/themes/catppuccin_mocha.nu") source ($nu.default-config-dir | path join "themes/catppuccin/themes/catppuccin_mocha.nu")