Asking sman to start HyperDoc when fricas is started with fricas -noht

23 views
Skip to first unread message

Grégory Vanuxem

unread,
Apr 9, 2024, 12:42:58 PM4/9/24
to fricas...@googlegroups.com
Hello,

See email object.

I would like to be able to only use HyperDoc when I want, and,
usually, not at startup time. The problem is if I use the ')hd' system
synonym when I close FriCAS, HyperDoc is still in use. I have to
manually close HyperDoc windows after closing FriCAS. So is there a
command or something like that to start it such that it will be closed
automatically?

Regards,
- Greg

Qian Yun

unread,
Apr 9, 2024, 7:48:12 PM4/9/24
to fricas...@googlegroups.com
When I start HyperDoc with ')hd', it automatically closes when
I quit FriCAS with ')q'.

- Qian

Grégory Vanuxem

unread,
Apr 9, 2024, 10:01:11 PM4/9/24
to fricas...@googlegroups.com
I can not reproduce that. Even with a freshly cloned Official FriCAS
on a pure Linux partition. That's very strange, you probably have a
setting that I don't know. Thanks anyway.
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/442c5e38-3c31-4588-98de-8cf3489d6d00%40gmail.com.

Waldek Hebisch

unread,
Apr 9, 2024, 10:22:17 PM4/9/24
to fricas...@googlegroups.com
On Wed, Apr 10, 2024 at 04:00:31AM +0200, Grégory Vanuxem wrote:
> I can not reproduce that. Even with a freshly cloned Official FriCAS
> on a pure Linux partition. That's very strange, you probably have a
> setting that I don't know. Thanks anyway.

I see the same as you. HyperDoc should quit, but it does not...
We need to investigate what is different in both cases.

--
Waldek Hebisch

Qian Yun

unread,
Apr 10, 2024, 6:00:35 AM4/10/24
to fricas...@googlegroups.com
I was using 1.3.10 release, no problem. Trunk version has this problem.

Bisect to commit 1936e863, "Rename 'OBEY' to '|run_shell_command|' and
implement with '|run_program|'".

This can be fixed by adding ":input t" to "sb-ext:run-program",
but I can not explain why.

diff --git a/src/lisp/fricas-lisp.lisp b/src/lisp/fricas-lisp.lisp
index 357aa063..5f3d58e2 100644
--- a/src/lisp/fricas-lisp.lisp
+++ b/src/lisp/fricas-lisp.lisp
@@ -918,7 +918,8 @@ with this hack and will try to convince the GCL
crowd to fix this.
(pop11:sysobey "/usr/bin/env" (cons command arguments))
#+:sbcl
(sb-ext:process-exit-code
- (sb-ext:run-program command arguments :search t :output
*standard-output*))
+ (sb-ext:run-program command arguments :search t :output
*standard-output*
+ :input t))
#+:gcl
(si:system (format nil "~{~a~^ ~}" (cons command arguments)))
)


- Qian

Waldek Hebisch

unread,
Apr 10, 2024, 9:36:17 AM4/10/24
to fricas...@googlegroups.com
On Wed, Apr 10, 2024 at 06:00:26PM +0800, Qian Yun wrote:
> I was using 1.3.10 release, no problem. Trunk version has this problem.
>
> Bisect to commit 1936e863, "Rename 'OBEY' to '|run_shell_command|' and
> implement with '|run_program|'".
>
> This can be fixed by adding ":input t" to "sb-ext:run-program",
> but I can not explain why.
>
> diff --git a/src/lisp/fricas-lisp.lisp b/src/lisp/fricas-lisp.lisp
> index 357aa063..5f3d58e2 100644
> --- a/src/lisp/fricas-lisp.lisp
> +++ b/src/lisp/fricas-lisp.lisp
> @@ -918,7 +918,8 @@ with this hack and will try to convince the GCL crowd to
> fix this.
> (pop11:sysobey "/usr/bin/env" (cons command arguments))
> #+:sbcl
> (sb-ext:process-exit-code
> - (sb-ext:run-program command arguments :search t :output
> *standard-output*))
> + (sb-ext:run-program command arguments :search t :output
> *standard-output*
> + :input t))
> #+:gcl
> (si:system (format nil "~{~a~^ ~}" (cons command arguments)))
> )

So in the trunk HyperDoc has /dev/null as standard input. In 1.3.10
it had the same standard input as FRICASsys (or sman if started
by sman). That still does not explain how HyperDoc decides if
it should exit. And what we should do in 'run_program': most
program will not read standard input, so for them difference
should not matter. But it is not clear what is better in
borderline cases.

--
Waldek Hebisch

Qian Yun

unread,
Apr 12, 2024, 11:53:44 PM4/12/24
to fricas...@googlegroups.com
The normal "hypertex" (started by sman) receives SIGTERM when we exit
fricas;

The "hypertex" started by ")hd" (with :input t) receives SIGHUP when
we exit fricas;

The "hypertex" started by ")hd" (with :input nil) receives no signal
when we exit fricas.

I have no further findings so far.

- Qian

Grégory Vanuxem

unread,
Apr 13, 2024, 4:39:02 AM4/13/24
to fricas...@googlegroups.com
Hello,

So what about writing a dedicated )hd routine or whatever name is
chosen so that HyperDoc receives signals from FriCAS ? As Waldek has
said, most programs will not read standard input.
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/01640ab7-d237-4e3f-93c3-5da4c6f1c76c%40gmail.com.

Grégory Vanuxem

unread,
Apr 29, 2024, 10:31:13 AM4/29/24
to fricas...@googlegroups.com
To add to this if you try to issue in the interpreter the )close
system command used to close down interpreter client processes
(examples run withHyperDoc for example) with an argument bad things
happen. From the doc )quietly is the possible argument but it is not
recognized, it throws an error, and if you use )quiet which I think is
what is required the command never returns. Apparently something bad
in i-syscmd.boot:selectOption. Will probably also add this issue to
GitHub later.

- Greg
Reply all
Reply to author
Forward
0 new messages