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

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
hi5
Power Member
Power Member
Posts: 641
Joined: 2012-11-03, 11:35 UTC
Contact:

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

Post 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.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Fla$her
Power Member
Power Member
Posts: 3015
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

2hi5
Don't forget about aliases.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50834
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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
Author of Total Commander
https://www.ghisler.com
hi5
Power Member
Power Member
Posts: 641
Joined: 2012-11-03, 11:35 UTC
Contact:

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

Post 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.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Post Reply