Disable Automatic Directory Changes?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 2, 2008
42
0
#1
Is there a way to disable automatic directory changes?
If not could that be added to the suggestion list?
Even better, could a special alias (like UNKNOWN_CMD, perhaps AUTO_CD) be added to allow redefining how automatic directory changes work?

For years I have aliased cd to something else, exactly what has varied. For example, I have often had cd aliased to *pushd. Unfortunately, automatic directory changes easily defeat any alias to cd/cdd/pushd/etc. I would like to ensure that all directory changes occur through a method of my choice. Now I'm in the habit of not using automatic directory changes, but every once in a while it happens anyway. Then of course my directory stack is incomplete and incorrect. I would, of course, prefer to maintain an accurate and complete directory stack.


- Josh
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,376
39
Albuquerque, NM
prospero.unm.edu
#2
For years I have aliased cd to something else, exactly what has varied. For example, I have often had cd aliased to *pushd. Unfortunately, automatic directory changes easily defeat any alias to cd/cdd/pushd/etc. I would like to ensure that all directory changes occur through a method of my choice. Now I'm in the habit of not using automatic directory changes, but every once in a while it happens anyway. Then of course my directory stack is incomplete and incorrect. I would, of course, prefer to maintain an accurate and complete directory stack.
You want all of your directory changes to be pushed onto the directory stack? Isn't that what the directory history is for? (Automatic directory changes are saved in the history.)
 
B

BillMc

Guest
#3
. On Sat 19-Jul-08 8:57am -0600, joshjeppson wrote:
.
. > Is there a way to disable automatic directory changes?
.
I can't think of what changed for automatic directory
changes from 4nt to tcc. What are you referring to?

There is the new "internal alias" called '-' for which most
of us already had a normal alias. The "internal alias" can
be overridden by a normal alias. For example:

alias -=`echos %_cwd&*-&echos -^^> %_cwd`

--
Best regards,
Bill
 
Jun 2, 2008
42
0
#4
You want all of your directory changes to be pushed onto the directory stack? Isn't that what the directory history is for? (Automatic directory changes are saved in the history.)
That was an example. What I want is to be able to guarantee that all directory changes occur via a mechanism I can customize. Currently I can override everything with aliases, except automatic directory changes.


- Josh
 
Jun 2, 2008
42
0
#5
. On Sat 19-Jul-08 8:57am -0600, joshjeppson wrote:
.
. > Is there a way to disable automatic directory changes?
.
I can't think of what changed for automatic directory
changes from 4nt to tcc. What are you referring to?

There is the new "internal alias" called '-' for which most
of us already had a normal alias. The "internal alias" can
be overridden by a normal alias. For example:

alias -=`echos %_cwd&*-&echos -^^> %_cwd`
It's not that something changed from 4NT to TCC. I've dealt with the automatic directory change behavior since it's inception and have worked around it because I rarely use it. I think I actually made a similar request years ago on the newsgroup.

If there is no way to disable automatic directory changes, which I believe there is not, then I would like Rex to add in v10 either a method to disable them or, even better, a method to override their behavior. I'm suggesting a NEW internal alias (AUTO_CD) that would be called whenever an automatic directory change occurred with the directory as a parameter.

If such an alias existed, I could then add whatever functionality I chose to all methods of directory change and bypassing it would require a conscious choice to not use the aliases.


- Josh
 

rconn

Administrator
Staff member
May 14, 2008
10,097
85
#6
Automatic Directory Changes

joshjeppson wrote:

> Is there a way to disable automatic directory changes?
> If not could that be added to the suggestion list?
> Even better, could a special alias (like UNKNOWN_CMD, perhaps AUTO_CD)
> be added to allow redefining how automatic directory changes work?
If you're referring to the directory changes when you enter the
directory name at the prompt (with a trailing backslash, and without a
preceding CD or CDD), then I'm afraid I don't understand the problem.
If you don't want to use that syntax, then why enter it?

(This has no effect on the directory stack, only on the directory history.)

Rex Conn
JP Software
 
Jun 2, 2008
42
0
#7
joshjeppson wrote:
If you're referring to the directory changes when you enter the
directory name at the prompt (with a trailing backslash, and without a
preceding CD or CDD), then I'm afraid I don't understand the problem.
If you don't want to use that syntax, then why enter it?
Actually, I would like to use the syntax. My problem is that I don't have any control over what that syntax does. So I would like to have that control or at least the ability to turn that syntax off to avoid the lack of control.

I just want a method to force all forms of directory changes through a single point. How I choose to use that is my problem. Currently automatic directory changes can NOT be redefined or disabled.


- Josh