GNU bug report logs -
#20336
24.4; Support ANSI escape Cursor Horizontal Absolute (CHA) positioning in term.el
Previous Next
Reported by: "Tim Taylor" <tim <at> tool-man.org>
Date: Wed, 15 Apr 2015 15:28:02 UTC
Severity: normal
Tags: patch
Merged with 23303
Found in versions 24.4, 24.5
Fixed in version 26.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20336 in the body.
You can then email your comments to 20336 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#20336
; Package
emacs
.
(Wed, 15 Apr 2015 15:28:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Tim Taylor" <tim <at> tool-man.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 15 Apr 2015 15:28:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Some CLIs use the ANSI escape `ESC[nG` (aka Cursor Horizontal Absolute
or CHA). For example, `ESC[0G` will move the cursor to column 0. This
escape currently isn't supported by `term-handle-ansi-escape`. The
output of a command like `npm install` appears a series of characters
like "-\|/-\|..." instead of the intended progress spinner effect.
The simplest test case:
printf "hello\033[0Gworld\n"
Within term/ansi-term will display "helloworld", but in other terminal
emulators display "world".
Relevant StackExchange Q&A including my workaround:
http://emacs.stackexchange.com/a/10698/6709
My workaround also included here:
(defun toolbear:term-handle-ansi-escape (proc char)
"Handle additional ansi escapes."
(cond
;; \E[nG - Cursor Horizontal Absolute, e.g. move cursor to column n (terminfo: cuf, cuf1)
((eq char ?G)
(let ((col (min term-width (max 0 term-terminal-parameter))))
(term-move-columns (- col (term-current-column)))))
(t)))
(advice-add 'term-handle-ansi-escape :before #'toolbear:term-handle-ansi-escape)
Cheers,
Tim
In GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.16)
of 2015-01-08 on resolute-tumbrel-6808.local
Configured using:
`configure --prefix=/opt/boxen/homebrew/Cellar/emacs/24.4
--enable-locallisppath=/opt/boxen/homebrew/share/emacs/site-lisp
--infodir=/opt/boxen/homebrew/Cellar/emacs/24.4/share/info/emacs
--without-dbus --without-gnutls --with-ns --disable-ns-self-contained'
Important settings:
value of $LC_CTYPE: en_US.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Emacs-Lisp
Minor modes in effect:
shell-dirtrack-mode: t
recentf-mode: t
diff-auto-refine-mode: t
show-paren-mode: t
global-linum-mode: t
linum-mode: t
ido-vertical-mode: t
ido-ubiquitous-mode: t
flx-ido-mode: t
global-auto-revert-mode: t
tooltip-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
O D ESC O C ESC O C ESC O C ESC O C ESC O D ESC O D
ESC O D ESC O C ESC O D DEL DEL DEL DEL C-e ESC O B
ESC O B ESC O B ESC O B C-x C-s ESC O A ESC O A ESC
O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A
ESC O A ESC O B C-@ ESC O B ESC O B ESC O B ESC O B
ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC
O B ESC O B ESC O B ESC O B ESC ; C-x C-s C-_ C-x s
! ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC
O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O B
ESC O B ESC O B C-@ ESC O B ESC O B ESC O B ESC O B
ESC O B ESC O B ESC O B ESC O B ESC O B C-\ ESC | p
b c o p y RET ESC O B ESC O A ESC O B ESC O B C-g C-_
C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_
C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ ESC
O C ESC O C ESC O C ESC O D DEL # ' C-x C-s ESC x b
u g TAB TAB DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL
DEL DEL DEL DEL r e p o r t TAB RET
Recent messages:
Mark activated
Loading quail/rfc1345...done
(Shell command succeeded with no output)
End of buffer [2 times]
Quit
Redo!
Undo! [25 times]
Saving file /Users/toolbear/src/dotfiles/emacs.d/toolbear/terminal.el...
Wrote /Users/toolbear/src/dotfiles/emacs.d/toolbear/terminal.el
Making completion list...
Load-path shadows:
/Users/toolbear/src/dotfiles/emacs.d/.cask/24.4.1/elpa/cask-20150327.208/cask hides /opt/boxen/homebrew/share/emacs/site-lisp/cask
/Users/toolbear/src/dotfiles/emacs.d/.cask/24.4.1/elpa/cask-20150327.208/cask-bootstrap hides /opt/boxen/homebrew/share/emacs/site-lisp/cask-bootstrap
Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mailabbrev
gmm-utils mailheader sendmail mail-utils rfc1345 quail debug mule-util
jka-compr eieio-opt speedbar sb-image ezimage dframe find-func
two-column tramp tramp-compat auth-source eieio eieio-core gnus-util
password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color
format-spec tmm misearch multi-isearch js imenu thingatpt cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs pp help-mode recentf tree-widget wid-edit vc-git diff-mode
easy-mmode xterm base16-atelierheath-dark-theme paren multi-term cl term
easymenu ehelp ring server disp-table edmacro kmacro linum hl-line
ido-vertical-mode ido-ubiquitous warnings flx-ido byte-opt bytecomp
byte-compile cconv flx ido pallet advice revbufs derived time-date
autorevert filenotify boxed-wine cask cl-macs gv cask-bootstrap
package-build mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr json lisp-mnt shut-up epl
git commander cl-loaddefs cl-lib f dash s ucs-normalize package
epg-config tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel ns-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode prog-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button
faces cus-face macroexp files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process cocoa ns multi-tty emacs)
Memory information:
((conses 16 1007815 128695)
(symbols 48 30733 0)
(miscs 40 2786 1728)
(strings 32 57759 18098)
(string-bytes 1 1635715)
(vectors 16 128739)
(vector-slots 8 4259818 15204)
(floats 8 25451 521)
(intervals 56 72709 5537)
(buffers 960 53))
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#20336
; Package
emacs
.
(Thu, 17 May 2018 22:34:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 20336 <at> debbugs.gnu.org (full text, mbox):
fixed 20336 26.1
unarchive 23303
forcemerge 23303 20336
quit
"Tim Taylor" <tim <at> tool-man.org> writes:
> The simplest test case:
>
>
> printf "hello\033[0Gworld\n"
>
>
> Within term/ansi-term will display "helloworld", but in other terminal
> emulators display "world".
This works in Emacs 26.
[1: caa31fcaa2]: 2016-04-21 18:59:37 +0300
Support absolute column movement in 'ansi-term'
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=caa31fcaa2fc7b05e411c8155d7641e7660a735a
bug Marked as fixed in versions 26.1.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 17 May 2018 22:34:02 GMT)
Full text and
rfc822 format available.
Forcibly Merged 20336 23303.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 17 May 2018 22:34:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 15 Jun 2018 11:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 6 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.