Restore %self to refer to the fish pid

This brings back the %self argument. Like the original %self it only expands
if the argument is literally %self.
This commit is contained in:
ridiculousfish
2018-10-10 14:26:29 -07:00
parent 6df29b2fd1
commit d73c487d60
8 changed files with 44 additions and 5 deletions

View File

@@ -924,7 +924,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */) {
wcstring version = str2wcstring(get_fish_version());
env_set_one(L"version", ENV_GLOBAL, version);
// Set the $fish_pid variable (%self replacement)
// Set the $fish_pid variable.
env_set_one(L"fish_pid", ENV_GLOBAL, to_string<long>(getpid()));
// Set the $hostname variable