Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ansi cursor escape codes prevent finding source file for compiler errors #13

Open
ricksorensen opened this issue Mar 24, 2021 · 1 comment

Comments

@ricksorensen
Copy link

I am running platformio with the current (MELPA installed) platformio-mode.el. When compile errors are generated, the escape characters for cursor motion are causing problems with the error file,line matching in emacs. I can work around this in two ways so far:

  1. Modifying system .bashrc to define
  export PLATFORMIO_NO_ANSI=true 
  export PLATFORMIO_FORCE_ANSI=false

resolves the issue.

  1. Changing command in platformio-mode.el in the platformio--exec function to run/build on line 81 from
    (cmd (concat "platformio -f -c emacs " target)))
    to
    (cmd (concat "platformio -f --no-ansi -c emacs " target)))

I was tying to figure out how to add the --no-ansi flag to the platformio.ini file, but have had no luck with this yet.

I am running emacs 26.3 on Ubuntu20.04

Here is a list of my installed packages:

  company-irony      1.1.0         installed
  company-irony-c... 1.0.0         installed
  csv-mode           1.15          installed
  eldoc              1.11.0        installed
  elpy               1.35.0        installed
  flycheck           31            installed
  flycheck-irony     0.1.0         installed
  gnuplot            0.8.0         installed
  lua-mode           20201010      installed
  platformio-mode    0.2.2         installed
  company            0.9.13        dependency
  dash               2.18.1        dependency
  epl                0.9           dependency
  highlight-inden... 0.7.0         dependency
  irony              1.4.0         dependency
  pkg-info           0.6           dependency
  projectile         2.3.0         dependency
  pyvenv             1.21          dependency
  s                  1.12.0        dependency
  yasnippet          0.14.0        dependency

Thank you for the nice package - Rick Sorensen

@ZachMassia
Copy link
Owner

Hi Rick,

Glad you like the package!

I had the morning off today so I finally got to sit down and take a look at this.

I'm guessing from the reading I did that there is no value in trying to keep these escape codes and properly format everything?

If so, I did find a few pages of interest:

--no-ansi seems to be the cleanest way of dealing with this.

They also provide the PLATFORMIO_NO_ANSI env var.

To be honest I don't even have platformio installed right now. I'll get everything set up on my end and see how the output looks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants