Deutsch   English   Français   Italiano  
<ldmfqjFgl6uU1@mid.individual.net>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Martijn Dekker <martijn@inlv.demon.nl>
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] Interactive subshell expansion disfunctional
Date: Sat, 22 Jun 2024 00:14:27 +0100
Lines: 50
Message-ID: <ldmfqjFgl6uU1@mid.individual.net>
References: <v2ijqc$mh11$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 57W87hxd+6V7BRMZsvg0WAXabSavxirIjx+kpe165nsFPdtJw=
Cancel-Lock: sha1:ihI8OX6eBAhpetoGY7+3GoICePc= sha256:tbiidheBlpiGa6MQkbqsX2DOFSxln61Nb86R0mtGLZI=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <v2ijqc$mh11$1@dont-email.me>
Bytes: 2654

Op 21-05-2024 om 17:57 schreef Janis Papanagnou:
> I recently replaced all original ksh93u+ by ksh93u+m, and meanwhile
> noticed quite some deficiencies, things that worked in original ksh
> but not any more in ksh93u+m.

I would of course be very interested in learning what deficiencies (other than 
the below) you've been observing.

> The latest observation is that in interactive mode with 'set -o vi'
> I was able to write a command substitution, say,
> 
>    ls $(date)
> 
> and with the cursor positioned (e.g.) at the closing parenthesis I
> could expand the argument by Esc-* to obtain
> 
>    ls 2024\-05\-21
> 
> This does not seem to work in ksh93u+m. - Is there a chance to get
> original ksh behavior back?

"Subshell expansion" was never meant to be a thing and is not documented 
anywhere. The behaviour was a bug; this was not supposed to happen. It also 
behaved inconsistently and crashed the shell in some cases.

For further details and rationale, please see:
https://github.com/ksh93/ksh/commit/7a2d3564
https://github.com/ksh93/ksh/issues/268

The documented behaviour of ESC-* in emacs is:

        M-*       Attempt pathname expansion on the current word.  An asterisk is
                  appended if the word doesn't match any file or contain any
                  special pattern characters.

Pathname expansion simply has no business executing code; that's not what it's 
for.

I can see how the behaviour as you describe it could come in handy, though. We 
could treat it as a feature request for version 93u+m/1.1 and up. It would 
have to be implemented properly. If implemented it should probably also be 
bound to a new key combination.

-- 
||    modernish -- harness the shell
||    https://github.com/modernish/modernish
||
||    KornShell lives!
||    https://github.com/ksh93/ksh