1

I'm using shells and enter to manage a "dirstack". I want to "popd" to remove dirs I've added.

I also have some aliases that I no longer want in my session. How do I delete the aliases?

I've tried things like drop but if the dirs and aliases are possibly immutable, how do I change them (without starting a new session)? Feels like there should be commands like leave (or unenter vs enter) and unalias (vs alias).

Micah Elliott
  • 9,600
  • 5
  • 51
  • 54
  • Looking at the list of built-in aliases, I now notice `dexit` which appears to drop a `shells` dir entry (though I can't find it in any docs). So maybe that half is solved for this. – Micah Elliott Aug 30 '23 at 18:40

1 Answers1

2

You can "Hide definitions in the current scope" with the hide command.

alias ll = ls -al
hide ll
ll
Error: nu::shell::external_command

  × External command failed
   ╭─[entry #49:1:1]
 1 │ ll
   · ─┬
   ·  ╰── did you mean 'all'?
   ╰────
  help: No such file or directory (os error 2)

As for the pushd/popd equivalency (see the docs), you can enter a new shell with enter, and exit it with dexit. You can inspect the table with shells or g, and activate the next or previous directory with n and p.

pmf
  • 24,478
  • 2
  • 22
  • 31