I'm looking for a command that invokes
readline or similar, primed with the current
$PWD, to let the user edit the current directory, then
cd to the edited value. E.g.
> cd ~/a/b/c/d > pwd > /home/alice/a/b/c/d
Then run the proposed
icd command (for "interactive
cd", inspired by
imv in renameutils). It prompts the user as follows:
> icd icd> /home/alice/a/b/c/d
Then the user can, e.g. press Alt-b, Alt-b, Alt-t, resulting in:
Upon pressing Enter, the
icd command changes the current directory to
icd would have some autocompletion. Maybe even visual indication of whether the current value is an existing/valid directory.
This can nearly be done in zsh by typing
> cd `pwd`
then pressing Tab. But a command like
icd would save keystrokes.
Related: Interactive cd (directory browser)