-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error handling prints ANSI color sequences in plaintext #366
Comments
When I first open an Org buffer and type the error code I do get the ANSI codes printed as plaintext in the buffer, but upon reverting the buffer they display the colors. If you revert the buffer do the sequences disappear and do you get the highlighting? Another thing, do you get highlighting when you run the following code? You should see the CD characters with a yellow background. #+begin_src jupyter-python :session test
print('AB\x1b[43mCD\x1b[0mEF')
#+end_src I'm on Emacs 27.1 with Org 9.4.4. The commit message of bb53fdd should have been more specific and said that the fontification is handled by font-lock in the Org buffer since we add to the value of |
OK, since you said it worked I went a little deeper to isolate the issue - turns out my minimal config wasn't minimal enough (I had still loaded a couple things inside my org config, which was all I activated within I will file a bug report there and disable the package until this is fixed. |
Adding this hook to my config appears to fix the output upon src block execution without disabling org-superstar. (defun display-ansi-colors ()
(ansi-color-apply-on-region (point-min) (point-max)))
(add-hook 'org-babel-after-execute-hook #'display-ansi-colors) |
@nnicandro I am also observing this issue and tried debugging it on my setup. I think the culprit to this issue may lie in the combination of the above mentioned emacs-jupyter commit bb53fdd in combination with emacs commit 21dcb9830a which renamed
I hope this helps towards figuring out a fix to this issue in emacs-jupyter. |
This function |
Since bb53fdd, errors in org are not printed correctly:
Reverting the aforementioned commit fixes this:
I think the commit was added under the assumption that org-mode will fontify, but it appears that it doesn't (at least for me on 27.1 with org 9.5.1, minimal config).
The text was updated successfully, but these errors were encountered: