tags 27407 + patch severity 27407 minor quit Pierre Neidhardt writes: > Steps to reproduce: > > - M-x eshell > - Enter "hello" > > The new prompt becomes yellow. You meant enter the text produced with (insert "echo \"\e[33mhello\e[0m\""). > It does not happen if the SGR reset sequence is not last. > This is fine for instance: > > - echo "hello"X > - echo -n "hello" > > Maybe an off-by-one error in the `ansi-*' function? The escape code is implemented by applying an overlay to the text following it (see `ansi-color-apply-on-region'). The problem seems to be that the reset sequence is translated to no face, so nothing is applied (see `ansi-color-apply-overlay-face'), and the yellow overlay gets extended despite the `ansi-color-freeze-overlay' modification-hook because `eshell-output-filter' (and `eshell-send-input') let-bind `inhibit-modification-hooks'. I'm not sure why `inhibit-modification-hooks' needs to be let-bound at all, but just binding it to nil around string insertion seems to be enough: