You can set term-char-mode-point-at-process-mark
to nil
to disable this behaviour, otherwise it's not possible to write a command to circumvent it because the point is moved back after the command is run. This is mentioned in etc/NEWS
of Emacs 26 (emphasis added):
*** 'term-char-mode' now makes its buffer read-only.
The buffer is made read-only to prevent changes from being made by
anything other than the process filter; and movements of point away
from the process mark are counter-acted so that the cursor is in the
correct position after each command. This is needed to avoid states
which are inconsistent with the state of the terminal understood by
the inferior process.
New user options 'term-char-mode-buffer-read-only' and
'term-char-mode-point-at-process-mark' control these behaviors, and
are non-nil by default. Customize these options to nil if you want
the previous behavior.
term-char-mode-point-at-process-mark
tonil
to avoid this (see its docstring). – npostavs Aug 24 '18 at 02:17(custom-set-variables '(term-char-mode-point-at-process-mark nil))
– djangoliv Aug 24 '18 at 07:53