On Fri, Nov 3, 2023 at 3:42 AM Japin Li <japi...@hotmail.com> wrote: > On Thu, 02 Nov 2023 at 22:23, Tom Lane <t...@sss.pgh.pa.us> wrote: > > Japin Li <japi...@hotmail.com> writes: > >> It seems the 'SEL\t' is converted to 'SEL ' which is "SEL" with 5 > >> spaces. > > > > That would be plausible if readline were disabled, or otherwise > > not functioning. > > > > I think this might be a bug comes from Illumos pseudo-tty. I can reproduce > this by using pseudo-tty on Illumos.
I don't know but my guess is that this has to do with termios defaults being different. From a quick look at 'man termios', perhaps TABDLY is set to expand tabs to spaces? Can you fix it by tweaking the flags in src/common/sprompt.c? Somewhere near the line that disables ECHO, perhaps you can figure out how to disable that in c_oflag? This is all the ancient forgotten magic that allows all Unixes to drive 70 year old electric typewriters, inserting suitable pauses and converting various things as it goes.