Page 1 of 1

Set minimum "string length" for command line history (Alt+F8)

Posted: 2023-04-11, 19:10 UTC
by hi5
By accident I have sometimes typed a letter in the command line (which I don't notice) and then a short while later I hit enter to open file or enter a directory but the letter is there so the "command" is executed which of course doesn't exist and you get a MsgBox warning. So far so good.

But I also often use the command line history and then I see these "letters" there which have no purpose, so perhaps a minimum length setting could be introduced so that commands "shorter then X" aren't added to the command line history. Even if you really have a one letter command (say "z.cmd" somewhere in your path) there is very little value (for me) to have that one letter "z" in the history as it is way faster to just type z again vs looking it up in the history which is more useful for longer commands.

I would set it to 3 for example, I have some 3 letter batch files that I simply retype because it is more work to get them back from the history.

The current behaviour can remain of course, but given the user the option to set a threshold would be nice I think.

Re: Set minimum "string length" for command line history (Alt+F8)

Posted: 2023-04-12, 05:24 UTC
by Fla$her
2hi5
Don't forget about aliases.

Re: Set minimum "string length" for command line history (Alt+F8)

Posted: 2023-04-14, 14:02 UTC
by ghisler(Author)
That only delays the problem - if you type a character there by accident, it can accumulate to 3.
But you can configure Total Commander to only execute the command line when it has the focus:
wincmd.ini
[Configuration]
ExecCmdLineFocused=1

Re: Set minimum "string length" for command line history (Alt+F8)

Posted: 2023-04-14, 19:36 UTC
by hi5
Often the letter appears because I meant to press modifier+key, but I don't press the down the modifier sufficiently, I think I would notice it it was there for "a long time" so to speak, as it is often "failed action", missed it, "correct action" do it, then moments later press enter -> error. So It would be rare to have two or more characters there I think.

But I'll give ExecCmdLineFocused=1 a shot and see how it goes.