2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-01-15 06:24:01 +00:00

Merge commit '8a7104a0a477f367614583afefd2fcd0dd06e506' (Remove $_)

Replaces $_ with $current_cmd. Closes .
$_ does not appear to be used anywhere in our codebase.
This commit is contained in:
Mahmoud Al-Qudsi 2018-03-10 22:35:26 -06:00
commit d367d57ae9
3 changed files with 5 additions and 5 deletions

View file

@ -102,7 +102,7 @@ int builtin_fg(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
} }
const wcstring ft = tok_first(j->command()); const wcstring ft = tok_first(j->command());
if (!ft.empty()) env_set_one(L"_", ENV_EXPORT, ft); if (!ft.empty()) env_set_one(L"current_cmd", ENV_EXPORT, ft);
reader_write_title(j->command()); reader_write_title(j->command());
job_promote(j); job_promote(j);

View file

@ -322,7 +322,7 @@ bool string_set_contains(const T &set, const wchar_t *val) {
/// Check if a variable may not be set using the set command. /// Check if a variable may not be set using the set command.
static bool is_read_only(const wchar_t *val) { static bool is_read_only(const wchar_t *val) {
const string_set_t env_read_only = {L"PWD", L"SHLVL", L"_", L"history", L"status", L"version", L"pid", L"hostname"}; const string_set_t env_read_only = {L"PWD", L"SHLVL", L"history", L"status", L"version", L"pid", L"hostname", L"current_cmd"};
return string_set_contains(env_read_only, val); return string_set_contains(env_read_only, val);
} }

View file

@ -1620,7 +1620,7 @@ static void reader_interactive_init() {
invalidate_termsize(); invalidate_termsize();
env_set_one(L"_", ENV_GLOBAL, L"fish"); env_set_one(L"current_cmd", ENV_GLOBAL, L"fish");
} }
/// Destroy data for interactive use. /// Destroy data for interactive use.
@ -1897,7 +1897,7 @@ void reader_run_command(parser_t &parser, const wcstring &cmd) {
wcstring ft = tok_first(cmd); wcstring ft = tok_first(cmd);
if (!ft.empty()) env_set_one(L"_", ENV_GLOBAL, ft); if (!ft.empty()) env_set_one(L"current_cmd", ENV_GLOBAL, ft);
reader_write_title(cmd); reader_write_title(cmd);
@ -1913,7 +1913,7 @@ void reader_run_command(parser_t &parser, const wcstring &cmd) {
term_steal(); term_steal();
env_set_one(L"_", ENV_GLOBAL, program_name); env_set_one(L"current_cmd", ENV_GLOBAL, program_name);
#ifdef HAVE__PROC_SELF_STAT #ifdef HAVE__PROC_SELF_STAT
proc_update_jiffies(); proc_update_jiffies();