unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Patrick Poitras <patrick.f.poitras@gmail.com>
To: 68724@debbugs.gnu.org
Subject: bug#68724: eshell/make doesn't properly handle color term characters
Date: Thu, 25 Jan 2024 16:54:45 -0800	[thread overview]
Message-ID: <CACpx+d57+TiNj8VqaG++Acjegu04oHZFib_54KP1BiLw=ApoHg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2152 bytes --]

In eshell, if I am in a directory and call `make`, the call that is
executed is (eshell/make) from em-unix.el.

The *compilation* window then pops up, which reads:
-------
make
g++ main.cpp -o main -lsfml-graphics -lsfml-window -lsfml-system
[01m [Kmain.cpp: [m [K In function ‘ [01m [Kint [01;32m [K main [m [K() [m
[K’:
[01m [Kmain.cpp:41:21: [m [K [01;31m [Kerror: [m [Ktoo few arguments to
function ‘ [01m [Kvoid [01;32m [K handleCamera [m [K(sf::View&, const
sf::Time&) [m [K’
   41 |         [01;31m [KhandleCamera(view) [m [K;
      |         [01;31m [K~~~~~~~~~~~~^~~~~~ [m [K
[01m [Kmain.cpp:7:6: [m [K [01;36m [Knote: [m [Kdeclared here
    7 | void [01;36m [KhandleCamera [m [K(sf::View &view, const sf::Time
&time) {
      |       [01;36m [K^~~~~~~~~~~~ [m [K
make: *** [Makefile:2: game] Error 1

Compilation exited abnormally with code 2 at Thu Jan 25 16:47:18, duration
0.28 s
------

Note that the garbled text above is not a problem with me copy-pasting it .
The screen I see really writes out these `[01;31m` characters all over,
making the message comprehensible.

I thought this might be a locale issue, so I called make like this:
------
~/Projects/SFML $ LC_LANG=en_US.utf8 make
-------
Which doesn't pop-up the *compilations* buffer, but does print the correct
output:
--------
g++ main.cpp -o main -lsfml-graphics -lsfml-window -lsfml-system
main.cpp: In function ‘int main()’:
main.cpp:41:21: error: too few arguments to function ‘void
handleCamera(sf::View&, const sf::Time&)’
   41 |         handleCamera(view);
      |         ~~~~~~~~~~~~^~~~~~
main.cpp:7:6: note: declared here
    7 | void handleCamera(sf::View &view, const sf::Time &time) {
      |      ^~~~~~~~~~~~
make: *** [Makefile:2: game] Error 1
------
Which is properly colored and everything.

I also figured out that the LC_LANG isn't special it's just bypassing the
call to the native function, in fact, you get the same result if you call
-------
ASDASDFASD=ASDFASDF make
-------

Is this a known behavior with a workaround, or how do I troubleshoot this
further.

Thanks,
Patrick

[-- Attachment #2: Type: text/html, Size: 2533 bytes --]

             reply	other threads:[~2024-01-26  0:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  0:54 Patrick Poitras [this message]
2024-01-26  1:18 ` bug#68724: eshell/make doesn't properly handle color term characters Jim Porter
2024-01-26  1:31   ` Patrick Poitras
2024-01-26  1:59     ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACpx+d57+TiNj8VqaG++Acjegu04oHZFib_54KP1BiLw=ApoHg@mail.gmail.com' \
    --to=patrick.f.poitras@gmail.com \
    --cc=68724@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).