Connecting Geiser to Guile listening to a socket: No prompt found! (.guile to blame)

  • Open
  • quality assurance status badge
Details
4 participants
  • Antonio Carlos Padoan Junior
  • Luis Felipe
  • Mekeor Melire
  • sirgazil
Owner
unassigned
Submitted by
sirgazil
Severity
normal
S
S
sirgazil wrote on 14 May 2019 13:17
(name . bug-guix)(address . bug-guix@gnu.org)
16ab60fa5c6.12a703b6121975.7975346690813311720@zoho.com
Hi,

I'm getting a "No prompt found!" error when I try to connect Geiser to a Guile REPL like this:

1. In a terminal, run "$ guile --listen=/tmp/guile-socket"
2. In Emacs, "M-x geiser-connect-local", then "guile", and finally "/tmp/guile-socket"

When the Guile REPL start in Emacs, I get a "No prompt found!" in the echo area, and the prompt in the REPL looks like this:


After trying some things out with help from str1ngs on #guix, we found out that the problem is related to the ".guile" file that seems to be generated by the system by default. In my case, ".guile" looks like this:

##########
(cond ((false-if-exception (resolve-interface '(ice-9 readline)))
=>
(lambda (module)
;; Enable completion and input history at the REPL.
((module-ref module 'activate-readline))))
(else
(display "Consider installing the 'guile-readline' package for
convenient interactive line editing and input history.\n\n")))

(unless (getenv "INSIDE_EMACS")
(cond ((false-if-exception (resolve-interface '(ice-9 colorized)))
=>
(lambda (module)
;; Enable completion and input history at the REPL.
((module-ref module 'activate-colorized))))
(else
(display "Consider installing the 'guile-colorized' package
for a colorful Guile experience.\n\n"))))
##########

When I remove this file and try to connect again, the "No prompt found!" error disappears, and the prompt looks normal.


## System information

$ guix describe
Generation 1 May 06 2019 11:29:00 (current)
guix d6a68e9
branch: master
commit: d6a68e90483b35bdc2ea78afe2c81873be67ec95

I'm using Emacs 26.2, Geiser 0.10, and Guile 2.2.4, all installed as Guix packages.


---
L
L
Luis Felipe wrote on 8 Dec 2020 17:45
(name . 35727@debbugs.gnu.org)(address . 35727@debbugs.gnu.org)
BXfIoAHFv891icyDl7sk-PueliJMMz8fb0tLySkh4ZPKOrdaVZYf7qa7zWgbPcx50pigGRPn78V3GMMLLCg2cLC9kY1ymeNIDI8M2M6yV3M=@protonmail.com
Hi, just to comment that this bug persists in the Guix System I'm using, with:

guix 08d8c2d
guile 3.0.4
emacs 27.1
geiser 0.12
M
M
Mekeor Melire wrote on 12 Dec 2022 14:32
(address . 35727@debbugs.gnu.org)
87mt7s7nfm.fsf@posteo.de
2019-05-14 06:17 sirgazil@zoho.com:

Toggle quote (46 lines)
> I'm getting a "No prompt found!" error when I try to connect
> Geiser to a Guile REPL like this:
>
> 1. In a terminal, run "$ guile --listen=/tmp/guile-socket"
> 2. In Emacs, "M-x geiser-connect-local", then "guile", and
> finally "/tmp/guile-socket"
>
> When the Guile REPL start in Emacs, I get a "No prompt found!"
> in the echo area, and the prompt in the REPL looks like this:
>
> https://multimedialib.files.wordpress.com/2019/05/emacs-geiser-guile-repl-no-prompt-found-2019-05-13.png
>
> After trying some things out with help from str1ngs on #guix, we
> found out that the problem is related to the ".guile" file that
> seems to be generated by the system by default. In my case,
> ".guile" looks like this:
>
> ##########
> (cond ((false-if-exception (resolve-interface '(ice-9
> readline)))
> =>
> (lambda (module)
> ;; Enable completion and input history at the REPL.
> ((module-ref module 'activate-readline))))
> (else
> (display "Consider installing the 'guile-readline'
> package for
> convenient interactive line editing and input history.\n\n")))
>
> (unless (getenv "INSIDE_EMACS")
> (cond ((false-if-exception (resolve-interface '(ice-9
> colorized)))
> =>
> (lambda (module)
> ;; Enable completion and input history at the
> REPL.
> ((module-ref module 'activate-colorized))))
> (else
> (display "Consider installing the
> 'guile-colorized' package
> for a colorful Guile experience.\n\n"))))
> ##########
>
> When I remove this file and try to connect again, the "No prompt
> found!" error disappears, and the prompt looks normal.

Does it work when you start the Guile REPL with an
environment-variable called INSIDE_EMACS? That way, it worked fine
for me:

#+begin_src sh
INSIDE_EMACS=true guix repl --listen=tcp:37146
#+end_src

If this works, then I'd suggest that this is not a bug but rather
you got to know that you need to deliver that environment variable
to guix/guile. We could then close this ticket.

Personally, I think this is only a bug in Geiser which should be
able to parse colored prompts.
A
A
Antonio Carlos Padoan Junior wrote on 12 Dec 2022 16:44
(name . Mekeor Melire)(address . mekeor@posteo.de)
87r0x4eieo.fsf@yahoo.com.br
Mekeor Melire <mekeor@posteo.de> writes:

Toggle quote (17 lines)
>
> Does it work when you start the Guile REPL with an
> environment-variable called INSIDE_EMACS? That way, it worked fine
> for me:
>
> #+begin_src sh
> INSIDE_EMACS=true guix repl --listen=tcp:37146
> #+end_src
>
> If this works, then I'd suggest that this is not a bug but rather
> you got to know that you need to deliver that environment variable
> to guix/guile. We could then close this ticket.
>
> Personally, I think this is only a bug in Geiser which should be
> able to parse colored prompts.
>

My feedback:
using INSIDE_EMACS=true works as well as starting guix repl from eshell.

Best regards,
--
Antonio Carlos PADOAN JUNIOR
GPG fingerprint:
243F 237F 2DD3 4DCA 4EA3 1341 2481 90F9 B421 A6C9
L
L
Luis Felipe wrote on 12 Jan 2023 18:32
(name . Mekeor Melire)(address . mekeor@posteo.de)
4OSgHyIoA9FcOs7UvhAGEpIDZEKomJpgbFYzJE6ndnM2-Z8Nk9ufAEFwUHpjOO53d2WE23_S5qar30scDanomf3-FF6gb8aTlI2KdohqD6A=@protonmail.com
Hi Mekeor,

On Monday, December 12th, 2022 at 13:32, Mekeor Melire <mekeor@posteo.de> wrote:

Toggle quote (3 lines)
> Does it work when you start the Guile REPL with an
> environment-variable called INSIDE_EMACS?

It does, thanks.


Toggle quote (4 lines)
> If this works, then I'd suggest that this is not a bug but rather
> you got to know that you need to deliver that environment variable
> to guix/guile. We could then close this ticket.

I'm not sure what would be the right place to document that tho...

Toggle quote (3 lines)
> Personally, I think this is only a bug in Geiser which should be
> able to parse colored prompts.

I just reported this to Geiser:


So I think I'll close this issue.
Attachment: signature.asc
L
L
Luis Felipe wrote on 12 Jan 2023 20:20
(name . Luis Felipe)(address . luis.felipe.la@protonmail.com)
mbAyyuPzmydWKSo9T9to1xMTfJo43weREZzcCiLFUmQtdaGI-Bvzy7nSpp06YqQgxoSzsy6OYkAlQlgMCcbCGuXeVdIGiFxonVeGXnS7x8E=@protonmail.com
On Thursday, January 12th, 2023 at 17:32, Luis Felipe <luis.felipe.la@protonmail.com> wrote:

Toggle quote (26 lines)
> Hi Mekeor,
>

> On Monday, December 12th, 2022 at 13:32, Mekeor Melire mekeor@posteo.de wrote:
>

> > Does it work when you start the Guile REPL with an
> > environment-variable called INSIDE_EMACS?
>

>

> It does, thanks.
>

> > If this works, then I'd suggest that this is not a bug but rather
> > you got to know that you need to deliver that environment variable
> > to guix/guile. We could then close this ticket.
>

> I'm not sure what would be the right place to document that tho...
>

> > Personally, I think this is only a bug in Geiser which should be
> > able to parse colored prompts.

Well, it turns out it is not:

«geiser guile is intended to work without extra .guile settings. my guess is that your .guile is possibly altering the looks of the prompt, that is explicitly not supported by geiser.» — jaor, https://gitlab.com/emacs-geiser/guile/-/issues/26
Attachment: signature.asc
?