Address you points: #1 VQ: With the exception of the file, this sounds nothing like the "history" command, so using that word runs the risk of confusing users. JS: It's a history of all the paths we used with cd command, so it might be confusing due to legacy use of history, but it is a type of history.
#2 VQ: This would make more sense as an extension of the existing "dirs" command (probably gated by a shopt and limited to interactive mode) than as as a separate command. JS: I wanted something as short as possible (dirs is relatively long to type). I know I can alias it, but I can't count the number of times I got on a customer vnc and they dont have my aliases and I have to type full commands. In addition, I wouldn't want to piggyback on a command that has a different functionality and is more for scripting. #3 VQ: I personally think this functionality is not general enough to integrate into the shell. JS: dh command is targeted towards a task all users do a lot. I would argue that cd is probably the most used builtin, so I don't see a problem providing a command that makes changing directories easier. thanks Jason On Sun, Jul 13, 2025 at 12:58 PM Lawrence Velázquez <v...@larryv.me> wrote: > On Sun, Jul 13, 2025, at 3:17 PM, jason stein wrote: > > *Pull Request:* > > https://github.com/jstein916/bash/pull/1 > > In general it's preferable to provide a patch directly (either inline > or as an attachment), rather than requiring prospective reviewers to > visit an external site. > > > *What the command dh does:* > > it adds a new command called "dh" which stands for directory history. > The > > new command is similar to history but deals exclusively with the > > directories that have been cd to. It creates a .bash_dirhistory file > > similar to history. > > With the exception of the file, this sounds nothing like the "history" > command, so using that word runs the risk of confusing users. (It's > not a rule or anything, but "history" usually implies "command history" > as far as shells are concerned.) > > > *Help from bash:* > > dh: dh [-ciw] [-m N] [N|partial_name] > > Directory history navigation. > > > > Display the directories that have been visited using the cd command, > > This would make more sense as an extension of the existing "dirs" > command (probably gated by a shopt and limited to interactive mode) > than as as a separate command. > > > ordered by frequency of access. Directories are numbered with the > most > > frequently accessed directory having index 1 (displayed last in the > > list). > > I personally think this functionality is not general enough to > integrate into the shell. > > -- > vq >