Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Checking for EMACS environment variable is not sufficient to determine if running in Emacs/SLIME #41

Open
atomontage opened this issue Jan 20, 2017 · 1 comment

Comments

@atomontage
Copy link

atomontage commented Jan 20, 2017

ANSI escapes will mess up the SLIME REPL buffer in Emacs (I think this is known already).

Emacs 25.1 here does not set the EMACS environment variable on subshells but it does
set INSIDE_EMACS e.g.

CL-USER> (sb-unix::posix-getenv "INSIDE_EMACS")
"25.1.1,comint"

CL-USER> (sb-unix::posix-getenv "EMACS")
NIL

Ideally you should check both EMACS and INSIDE_EMACS.

Finally, to be super-duper pedantic about this, it'd be amazing if the entire color part was made optional
(via separate ASDF system) so that those of us who despise colors of any sort in our test output
don't have to install dependencies we'll never use.

@Ferada
Copy link

Ferada commented Jul 4, 2017

Just ran into this too and voting for it too. I never knew that Emacs sets those.

Also I think a better approach re the dependencies would be push a feature flag for it, so that loading prove will only conditionally add the dependencies for colours. Since other systems will only want to load the generic prove system, having two ASDF system wouldn't really work, would it?

(Lastly, another common check is whether the output is connected to a terminal, isatty basically - at least that's a case where you probably do want colours. But I imagine that's not available portably, or in UIOP yet; while osicat has it, getting the right FD would be another nightmare. Nevermind then.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants