all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#34224: 25.1; ansi-term displays garbage on tree(1) command
@ 2019-01-27 18:09 Marvin Gülker
  2019-01-28 11:03 ` Phil Sainty
  0 siblings, 1 reply; 6+ messages in thread
From: Marvin Gülker @ 2019-01-27 18:09 UTC (permalink / raw)
  To: 34224


The ansi-term (and likewise, term) modes fail to properly display the
Unicode drawing characters used by the tree(1) command. Steps to
reproduce:

1. Run M-x ansi-term
2. Switch to the directory you want to tree(1)
3. Execute tree command
4. The output looks like this:

    testtree
    0tqq Ba
    0tqq Bb
    0x   tqq Bb-a
    0x   mqq Bb-b
    0mqq Bc

Whereas it should look like this:

    testtree
    ├── a
    ├── b
    │   ├── b-a
    │   └── b-b
    └── c

This is on Debian Linux using the GUI emacs.



In GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-09-15, modified by Debian built on trouble
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:	Debian GNU/Linux 9.7 (stretch)

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --with-x=yes --with-x-toolkit=gtk3
 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs25-wN2qS3/emacs25-25.1+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Term

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode cl-loaddefs pcase
cl-lib mail-prsvr mail-utils term disp-table easymenu ehelp ring
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded 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 dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 90204 7403)
 (symbols 48 20271 0)
 (miscs 40 53 146)
 (strings 32 15590 4312)
 (string-bytes 1 444050)
 (vectors 16 12487)
 (vector-slots 8 438436 6828)
 (floats 8 164 11)
 (intervals 56 329 17)
 (buffers 976 19))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34224: 25.1; ansi-term displays garbage on tree(1) command
  2019-01-27 18:09 bug#34224: 25.1; ansi-term displays garbage on tree(1) command Marvin Gülker
@ 2019-01-28 11:03 ` Phil Sainty
  2019-01-28 13:10   ` Marvin Gülker
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Sainty @ 2019-01-28 11:03 UTC (permalink / raw)
  To: Marvin Gülker, 34224

FYI I can't replicate that in 25.3 or 26.1 under Ubuntu GNU/Linux 18.04.

(i.e. The tree output looks correct to me.)

Does the same thing happen if you run emacs -Q ?

Are you able to install 25.3 for testing?

Perhaps this is just a font problem at your end?


-Phil





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34224: 25.1; ansi-term displays garbage on tree(1) command
  2019-01-28 11:03 ` Phil Sainty
@ 2019-01-28 13:10   ` Marvin Gülker
  2019-01-28 15:47     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Marvin Gülker @ 2019-01-28 13:10 UTC (permalink / raw)
  To: Phil Sainty; +Cc: 34224

Am 29. Januar 2019 um 00:03 Uhr +1300 schrieb Phil Sainty:
> FYI I can't replicate that in 25.3 or 26.1 under Ubuntu GNU/Linux 18.04.
> 
> (i.e. The tree output looks correct to me.)
> 
> Does the same thing happen if you run emacs -Q ?

Yes, it happens with emacs -Q. But when I reported the bug, I forgot
that since pretty much forever I had an alias for "tree" in my zsh
config that aliases the tree command to "tree -AC". Removing the alias
solves the problem. Fiddling shows the it's the -A option that causes
the problem. So, the actual problem is that ansi-term doesn't work
with tree's -A option.

Given that the -A option is declared as a "hack" in tree's manual page,
I don't know whether it should actually be cared about. I don't really
remember what made me turn this option on in my alias. Since a few years
I use urxvt as my terminal emulator, so it might have been a faulty
terminal emulator. When I switched to urxvt, I probably forgot about
it. urxvt never had a problem with that option, though.

> Are you able to install 25.3 for testing?

Yes, I just compiled it from source. The problem still exists with emacs
25.3.

> Perhaps this is just a font problem at your end?

See above; it's tree's -A option.

Marvin

-- 
Blog: https://mg.guelker.eu
PGP/GPG ID: F1D8799FBCC8BC4F





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34224: 25.1; ansi-term displays garbage on tree(1) command
  2019-01-28 13:10   ` Marvin Gülker
@ 2019-01-28 15:47     ` Eli Zaretskii
  2019-01-28 21:10       ` Phil Sainty
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2019-01-28 15:47 UTC (permalink / raw)
  To: Marvin Gülker; +Cc: psainty, 34224

> Date: Mon, 28 Jan 2019 14:10:53 +0100
> From: Marvin Gülker <m-guelker@phoenixmail.de>
> Cc: 34224@debbugs.gnu.org
> 
> Yes, it happens with emacs -Q. But when I reported the bug, I forgot
> that since pretty much forever I had an alias for "tree" in my zsh
> config that aliases the tree command to "tree -AC". Removing the alias
> solves the problem. Fiddling shows the it's the -A option that causes
> the problem. So, the actual problem is that ansi-term doesn't work
> with tree's -A option.
> 
> Given that the -A option is declared as a "hack" in tree's manual page,
> I don't know whether it should actually be cared about.

If someone can tell what does 'tree' do to "turn on ANSI line graphics
hack", then perhaps we could decide whether there's something wrong
with how Emacs interprets the bytestream delivered to it by 'tree' in
this mode.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34224: 25.1; ansi-term displays garbage on tree(1) command
  2019-01-28 15:47     ` Eli Zaretskii
@ 2019-01-28 21:10       ` Phil Sainty
  2019-01-29 16:17         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Sainty @ 2019-01-28 21:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Marvin Gülker, 34224

On 2019-01-29 04:47, Eli Zaretskii wrote:
> If someone can tell what does 'tree' do to "turn on ANSI line graphics
> hack", then perhaps we could decide whether there's something wrong
> with how Emacs interprets the bytestream delivered to it by 'tree' in
> this mode.

Does this help?


$ tree -A | cat -v
.
^[(0tqq ^[(Bbar
^[(0tqq ^[(Bfoo
^[(0mqq ^[(Bsubdir
^[(0    tqq ^[(Bbar
^[(0    mqq ^[(Bfoo

1 directory, 4 files


$ tree -A
.
0tqq Bbar
0tqq Bfoo
0mqq Bsubdir
0    tqq Bbar
0    mqq Bfoo

1 directory, 4 files


$ tree
.
├── bar
├── foo
└── subdir
     ├── bar
     └── foo

1 directory, 4 files


I note that the 'tqq' and 'mqq' match up with the VT column at:

http://www.robelle.com/smugbook/linedraw.html







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34224: 25.1; ansi-term displays garbage on tree(1) command
  2019-01-28 21:10       ` Phil Sainty
@ 2019-01-29 16:17         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2019-01-29 16:17 UTC (permalink / raw)
  To: Phil Sainty; +Cc: m-guelker, 34224

severity 34224 wishlist
thanks

> Date: Tue, 29 Jan 2019 10:10:54 +1300
> From: Phil Sainty <psainty@orcon.net.nz>
> Cc: Marvin Gülker <m-guelker@phoenixmail.de>,
>  34224@debbugs.gnu.org
> 
> On 2019-01-29 04:47, Eli Zaretskii wrote:
> > If someone can tell what does 'tree' do to "turn on ANSI line graphics
> > hack", then perhaps we could decide whether there's something wrong
> > with how Emacs interprets the bytestream delivered to it by 'tree' in
> > this mode.
> 
> Does this help?
> 
> 
> $ tree -A | cat -v
> .
> ^[(0tqq ^[(Bbar
> ^[(0tqq ^[(Bfoo
> ^[(0mqq ^[(Bsubdir
> ^[(0    tqq ^[(Bbar
> ^[(0    mqq ^[(Bfoo
> 
> 1 directory, 4 files

Yes, thanks.  These are escape sequences which term.el doesn't
currently support:

  (defun term-emulate-terminal (proc str)
  [...]
		  ;; Ignore NUL, Shift Out, Shift In.
		  ((or ?\0 #xE #xF 'nil) nil))

Patches to add such support are welcome.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-29 16:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-27 18:09 bug#34224: 25.1; ansi-term displays garbage on tree(1) command Marvin Gülker
2019-01-28 11:03 ` Phil Sainty
2019-01-28 13:10   ` Marvin Gülker
2019-01-28 15:47     ` Eli Zaretskii
2019-01-28 21:10       ` Phil Sainty
2019-01-29 16:17         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.