I just installed the mksh and don't know how to solve one litte problem I have. When trying to change directory to the parent directory mksh does not complete when pressing "tab". Let me visualize:

$ cd .."tab"

will not end in

$ cd ../

What needs to be added to the mkshrc in order to get this feature?

Thanks in advance!

  • looks like a bug in mksh. maybe try ksh93 instead. or bash. – cas Nov 17 '15 at 22:39
  • 2
    Presumably that's not done because it's pointless: ../ and ..<TAB> require the same number of keypresses. Even zsh doesn't complete .. to ../ by default (though being zsh it has an option to enable it). – Gilles Nov 17 '15 at 23:39
  • @Gilles Well, pointless is relative. I have a german keyboard and pressing "/" requires shift+7 whereas "tab" ist just "tab". – famfop Nov 18 '15 at 13:51

Tab completion uses globbing internally. In mksh (and possibly other Korn Shell variants), . and .. are never matched in globbing (to prevent accidents with rm, mostly).

Using a German keyboard is unfortunate, otherwise I’d say I’m with @Gilles on this… (I switched from de to us layout and don’t regret it, personally). But this does mean that there is nothing you can do to make mksh tabcomplete ...

If you need it often, you could use this:

function .. {
    cd ../"$1"

Unfortunately, this would still not allow tab-completing through it. So, Shift-7 or switching kezboard (spelling intended) layout is the way to go.

Disclaimer: I’m the developer.

  • Well, although I'm not happy with it I guess I'll have to accept it. Still, thanks for the reply. oh, and +1 for kezboard ;) – famfop Nov 19 '15 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.