bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49186: ansi-term switch to char mode immediately executes string at


From: Lars Ingebrigtsen
Subject: bug#49186: ansi-term switch to char mode immediately executes string at prompt
Date: Wed, 23 Jun 2021 15:21:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

simon254--- via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

> For example, C-c C-j, then typing ls and then C-c C-k -> ls is
> executed. However, If I type ls and then C-c C-j followed by C-c C-k, it does 
> not execute ls
>
> Bug affects emacs version 27 and 28

I can reproduce the behaviour.  To reproduce:

emacs -Q
M-x ansi-term RET RET
`C-c C-j l s C-c C-k'

In Emacs 26, this won't execute ls, but in Emacs 28 it does (and so it
does in Emacs 25.1).

The code for `term-char-mode' (i.e., `C-c C-k') seems to indicate that
the intention of the `C-c C-k' was to behave like Emacs 28 does now:

    ;; Send existing partial line to inferior (without newline).
    (let ((pmark (process-mark (get-buffer-process (current-buffer))))
          (save-input-sender term-input-sender))
      (when (> (point) pmark)
        (unwind-protect
            (progn
              (setq term-input-sender
                    (symbol-function 'term-send-string))
              (end-of-line)
              (term-send-input))
          (setq term-input-sender save-input-sender))))

But this didn't work in Emacs 26.1, but has been fixed now.

I don't use ansi-term myself much -- I think it's pretty peculiar that
`C-c C-k' sends partial line inputs to the shell.  Does anybody know
what the rationale for this is?  The code has been like this since 1994,
and Emacs 25 works like Emacs 28.  (So it's Emacs 26.1 that's broken
here.)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]