Follow-up a bit later, currently I am using

--8<---------------cut here---------------start------------->8---
(when (and (isatty? (current-input-port))
           ;; Best detection for geiser-mode I came up with.
           (not (and=> (getenv "INSIDE_EMACS")
                       (lambda (v) (string-contains v ",comint")))))
  (and=> (false-if-exception (resolve-interface '(ice-9 readline)))
         (lambda (module)
           ((module-ref module 'activate-readline))))

  (and=> (false-if-exception (resolve-interface '(ice-9 colorized)))
         (lambda (module)
           ((module-ref module 'activate-colorized)))))
--8<---------------cut here---------------end--------------->8---

which seems to have low-enough chance of false positive.

Tomas
-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.



Reply via email to