Use built-in functions for elvish (#7025)

Currently the elvish shell integration uses the `hostname` command, this
may not exist on all systems and is somewhat redundant to rely on when
elvish has an
[`platform:hostname`](https://elv.sh/ref/platform.html#platform:hostname)
function that can be used and will work across platform regardless of
command availability. On top of this instead of directly calling the
`pwd` function we can simply use the built-in
[`$pwd`](https://elv.sh/ref/builtin.html#$pwd) variable that elvish
gives us. This should prevent the shell integration from breaking due to
external function availability.
This commit is contained in:
Jon Parise
2025-04-07 18:09:09 -04:00
committed by GitHub

View File

@@ -75,7 +75,8 @@
}
fn report-pwd {
printf "\e]7;file://%s%s\a" (hostname) (pwd)
use platform
printf "\e]7;file://%s%s\a" platform:hostname $pwd
}
fn sudo-with-terminfo {|@args|