On 2/3/24 10:18 PM, Zachary Santer wrote:

While I'm making feature requests.

I hit C-x C-e and enter the following into my editor:

var='duck'
declare -p var
(
   var='squirrel'
   declare -p var
)
declare -p var

I save that and exit my editor, and this is what I get in the terminal:

zsant@Zack2021HPPavilion MINGW64 ~
$
var='duck'
declare -p var
declare -- var="duck"
(
   var='squirrel'
   declare -p var
)
declare -- var="squirrel"
declare -p var
declare -- var="duck"

Kinda confusing, right?

I could see adding PS1 and PS2 prompts where they would've been, had I typed all my commands into the terminal directly. PS2 prompts in front of everything that was entered in the editor might be preferable, though, given the complex PS1s you see sometimes.

I'd have to think about it. This isn't interactive input read from the
keyboard, where you'd expect to get a prompt. This is more like sourcing
a file with `set -v' temporarily enabled (in fact, it's very close to
that).

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to