- May
- 13,117
- 180
Can the special PRE_EXEC alias prevent the execution of the current command (conditionally, of course)?
Again I was thinking of Steve's wanting to handle the loss of the current directory gracefully. This alias does it, but uses a plugin.
With that, if the network was disconnected and the current directory invalid, I see for example
The error message is nice; the "^C" not so nice. I was wondering if it could be done with only built-in tools.
Again I was thinking of Steve's wanting to handle the loss of the current directory gracefully. This alias does it, but uses a plugin.
Code:
v:\> alias pre_exec
if not isdir %_cwd ( cdd v:\ & genbreak )
Code:
\\lucky\v$> dir
TCC: (Sys) The specified network name is no longer available.
^C
v:\>