Lars Ingebrigtsen writes: > miha@kamnitnik.top 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.) Yeah I thought about that too. However, commands such as 'yank' or 'just-one-space' use insert rather than insert-and-inherit and thus always bypass inheritance of surrounding text properties regardless of it's stickiness. That is why I settled for using the 'insert-in-front-hooks' text property, patch attached.