Subject: bug#3735: bug#18135: bug#3735: shell-mode editing, movement, and command entry broken by prompt/output changes

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 05 Dec 2021 20:27:16 +0100

[email-masked] writes:

> Reproducer:
>
> - copy " -la" into kill ring
> - type "echo ls" into M-x shell
> - (Shell gives output line "ls".)
> - Go up to output line "ls" (C-p).
> - yank " -la"
> - press C-b
> - the line now "ls -la" with point after "l"
> - press RET
>
> Only " -la" is sent to the process instead of "ls -la"

Thanks; with that I'm also able to reproduce the problem.

> I am willing to write up a patch to fix this. I'm thinking of having
> comint-mode register a function in after-change-functions to mark text
> inserted in the 'output' field as 'output'. Would this be okay or are
> there any obvious flaws with this approach?

I think that sounds like a promising approach, but I wonder whether
something could be done with rear-nonsticky here.  `field' isn't
rear-sticky here for probably good reasons, but perhaps something could
be tweaked there?  (I haven't actually tried, though.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no