Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
Re: bin/ksh: add keep-tilde completion option
To:
tech@openbsd.org
Date:
Mon, 26 Jan 2026 23:24:30 +0100

Download raw body.

Thread
On Mon, 26 Jan 2026 21:44:24 +0100,
Steffen Nurpmeso <steffen@sdaoden.eu> wrote:
> 
> Hello, interesting problem!
> 
> Kirill A. Korinsky wrote in
>  <87ecncb6op.wl-kirill@korins.ky>:
>  |tech@,
>  |
>  |this is a new optional feature for ksh: keep ~ as unexpanded for complet\
>  |ion.
>  |
>  |Not sure does I only one who prefer to keep short path with ~ isntead \
>  |expand
>  |to /home/user/
>  |
>  |Feedbacks? Ok?
> 
> The former only -- why wouldn't you "simply" do ./~<TAB> do avoid
> expansion altogether?  (Ie on case-by-case basis?)  (Having said
> that, it seems bash just does not do it the way i would expect, my
> mailer does, but does not iterate over a la getpwent() at all
> (only expands valid ~USER, not expanding ~U to USER first, you
> know).
>

Because it doesn't work!

~ $ echo ./~
./~
~ $ ls ./~   
ls: ./~: No such file or directory
~ $ 


My patch allows to make this:

~ $ touch ~/abc{,def}
~ $ touch ~/abc [press TAB here]
abc     abcdef  
~ $ touch ~/abc 

and without patch it works this way:

~ $ touch ~/abc [press TAB here]

it expands to

~ $ touch /home/catap/abc                                                                                                                                 

and only second press TAB leads to

~ $ touch /home/catap/abc
abc     abcdef  
~ $ touch /home/catap/abc 


-- 
wbr, Kirill