If I have the folder ~/1234567 and I type one of the following:

ls ~/123
cd ~/12

then press tab, everything's groovy. But if, on either of those commands, I type 1234 before hitting tab, the 4th char is replaced with / and editing text becomes strange; if I hit return it's as if anything after ~ is ignored. This is repeatable in different locations in the filesystem, and does not depend on which other files/folders are at that location.

This works as expected on bash on the same box. I'm using rhel6.9, and version "93u+ 2012-08-01" of ksh.

I only have this problem if I use ~ and I don't have it if I use the ~username form; just ~/xxxx.

  • ksh --version should give you the version. Do you have the same issue if you first run PS1='$ ' and then try the same completion? – terdon May 18 '17 at 10:11
  • @terdon Thanks, updated question with ksh version. And no change with that prompt. – user13757 May 18 '17 at 10:13
  • This also occurs if the combined length of the username and dir/file is four characters: cd ~kk/lo<tab>, and it only occurs in Vi-editing mode it seems. Thanks for spotting this! I've been wondering for years why this sometimes seems to break. I've tried to submit an issue on the att/ksh GitHub, but I'm not sure that's the right place for it... – Kusalananda May 19 '17 at 7:56

I can confirm that this bug exists on other Unices running ksh93 too.

Looking at how the current development version of the ksh93 shell handles this, this particular bug seems to have been fixed.

The development version is available from GitHub (on the master branch) and the version I tried reports a version string of Version A 93v-1400-g3d8a9fe4.

As far as I'm aware, there is no date currently set for the next release, but judging from the frequent commits to the code base, there is development happening.

Your Answer

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