Re: [fricas/fricas] Hardcoded 'xterm' (Issue #119)

22 views
Skip to first unread message

Grégory Vanuxem

unread,
Mar 2, 2023, 10:26:00 AM3/2/23
to fricas/fricas, fricas...@googlegroups.com
Le jeu. 2 mars 2023 à 04:21, hebisch <notifi...@github.com> a écrit :
On Wed, Mar 01, 2023 at 04:07:11AM -0800, Greg wrote:
> On WSL 2, it's a real Linux system. Yes. With an extended 4 filesystem.
>
> $uname -a
> Linux ellipse 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13
> UTC 2023 x86_64 GNU/Linux
>
> Applications have no cues to know they are on a Linux system virtualized
> via the processor capability. It's not on an emulated system. Maybe I said
> that but no, it's really Linux. The only difference I know of is that
> 'init' and its different levels have no meanings, you have to start
> yourself the necessary services and X has no real use since you're on the
> 'explorer.exe' Window Manager (unless via 'xrdp').

I am not sure what window manager have to do with "use of X". AFAIK
you can run X server on Windows (just Windows, without need for WSL).
If WSL is real Linux, then it can make network connections and
connect to X under Windows. So any program using X should work
in this setup. Of course, using network connctions you need to
fight with Windows firewall which may be too hard average
Windows user.

The X.Org X Window System. And I know for X server on Windows but, I never wanted to afford it, and from my point of view the free version is not of the required quality. Furthermore there is now WSL with GUI apps support, I can now run 'xterm' for example without starting xrdp/Xorg. That was the _very_ good news of the week for me.

Here are some explanations I wrote two days ago:

I use Linux in a virtualized environment, WSL, via the Intel
Virtualization Technology (Intel VT), there is also the  AMD
Virtualization (AMD-V). See:
https://learn.microsoft.com/en-us/windows/wsl/about

And I start X via the Linux xrdp server, and connect to X via the RDP
protocol from Windows. This is highly resource consuming, so I do not
use this method a lot, and I prefer using FriCAS directly in a Windows Linux shell (wsl.exe
in a PowerShell).

(EDIT: I have just seen that Intel (AMD and NVIDIA too) now supports
WSL GPU emulation with new drivers since the end of 2022 apparently
and I can since _today_ use X apps directly from Windows. Good news for
me!)

So I can now run FriCAS with HyperDoc and graphics on Windows (just as with X.)
https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

That was not possible in the past.
 

And in current times Linux have a lot of graphic programs. Does
WSL support running graphic programs? If yes, then question is
how?

Yes. I discovered this two days ago,I don't really know how, virtual GPU apparently (see links above).

But I reiterate, I think, first add 'xterm' as a prerequisite in the INSTALL file for now, and modify the help file to not mention EDITOR env var or use it really in SPADEDIT. Secondly, allow the use of 'vi' as EDITOR|FRICASEDITOR. Or any others, like gvim or emacs. Unless you do not encounter this issue of course. Personally, I installed mate-desktop and later xorg-dev Debian packages, I effectively had to manually add the Debian xterm package.

$export FRICASEDITOR=vi
$fricas
[...]
)edit /home/greg/.bashrc
gives nothing (even in mate via X.Org under the RDP protocol).

If it is 'gvim' or 'emacs' as EDITOR|FRICASEDITOR the file is not edited, just gvim or emacs are loaded with an empty file.

So the example in )help edit:
)edit /u/julius/matrix.input
Does not edit this file with an editor instead of 'more' which runs nicely in an _xterm_.

That's all. I can send a really simple patch if necessary of course, just which one of EDITOR or FRICASEDITOR must be chosen.
Personally I would choose EDITOR but I don't think you would agree.
__
Greg
Message ID: <fricas/fricas/issues/119/1451239816@github.com>

Ralf Hemmecke

unread,
Mar 2, 2023, 11:06:58 AM3/2/23
to fricas...@googlegroups.com
> $export FRICASEDITOR=vi

As you see from the SPADEDIT file, you should rather set something like

export FRICASEDITOR='vi +$line $name'

or with emacs instead of vi.

You have to choose the right command line parameters for your editor.
$line and $name will be replaced by the filename and line number.

Can you check whether that works?

Ralf

Grégory Vanuxem

unread,
Mar 2, 2023, 11:32:40 AM3/2/23
to fricas...@googlegroups.com
Nothing with 'vi', I had to kill the FRICASsys processus myself.

With 'gvim' or 'emacs' that opens the file but 'gvim' complains that
the 'line' command is unknown.
Error detected while processing command line:
E492: Not an editor command: line
> --
> 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/074eebf6-49c5-da2c-2f62-886074eb46d4%40hemmecke.org.

Ralf Hemmecke

unread,
Mar 2, 2023, 12:30:38 PM3/2/23
to fricas...@googlegroups.com
On 02.03.23 17:32, Grégory Vanuxem wrote:
> Nothing with 'vi', I had to kill the FRICASsys processus myself.
>
> With 'gvim' or 'emacs' that opens the file but 'gvim' complains that
> the 'line' command is unknown.
> Error detected while processing command line:
> E492: Not an editor command: line

Huh? What exactly did you write? Please always copy the exact procedure
into the mail. The your message looks strange. Your FRICASEDITOR
variable should not show "line", but "$line".

But don't worry, I get the impression that edit does not really work
nicely via a non-X connection. I just did "ssh somecomputer" (no X
forwarding). Then I started fricas like this

export FRICASEDITOR='emacs -nw +$line $name'
fricas

)edit /home/hemmecke/foo.txt

Emacs starts but shows some strange escape characters...
THe first likes look like

File Edit Options Buffers Tools Text Help

^[[>65;6800;1c^[[I


and ends with

-UU-:----F1 foo.txt All (1,0) (Text WS Fill)
----------------------
For information about GNU Emacs and the GNU system, type C-h C-a.


but does not fill my local terminal window. And worst of all, I cannot
do anything there.
Ctrl-X Ctrl-C
leads to



>> System error:

Interactive interrupt at #x7FABD2204D2F.



(1) -> ^[[>65;6800;1c^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^Xc^X


That is probably a problem in FriCAS sman redirecting I/O appropriately.

Starting "fricas -nosman" seems to start emacs as it should, though.

Ralf

Grégory Vanuxem

unread,
Mar 2, 2023, 3:09:22 PM3/2/23
to fricas...@googlegroups.com
Le jeu. 2 mars 2023 à 18:31, Ralf Hemmecke <ra...@hemmecke.org> a écrit :
>
> On 02.03.23 17:32, Grégory Vanuxem wrote:
> > Nothing with 'vi', I had to kill the FRICASsys processus myself.
> >
> > With 'gvim' or 'emacs' that opens the file but 'gvim' complains that
> > the 'line' command is unknown.
> > Error detected while processing command line:
> > E492: Not an editor command: line
>
> Huh? What exactly did you write? Please always copy the exact procedure
> into the mail. The your message looks strange. Your FRICASEDITOR
> variable should not show "line", but "$line".

Oh, sorry, I forgot the dollar sign before 'line'.
So good with gvim and emacs, emacs displays the file and at bottom the
welcome page though.
vi, as I said nothing and I add again to kill -9 it.


>
> But don't worry, I get the impression that edit does not really work
> nicely via a non-X connection. I just did "ssh somecomputer" (no X
> forwarding). Then I started fricas like this
>
> export FRICASEDITOR='emacs -nw +$line $name'
> fricas
>
> )edit /home/hemmecke/foo.txt
>
> Emacs starts but shows some strange escape characters...
> THe first likes look like
>
> File Edit Options Buffers Tools Text Help
>
> ^[[>65;6800;1c^[[I
>
>
> and ends with
>
> -UU-:----F1 foo.txt All (1,0) (Text WS Fill)
> ----------------------
> For information about GNU Emacs and the GNU system, type C-h C-a.
>
>
> but does not fill my local terminal window. And worst of all, I cannot
> do anything there.
> Ctrl-X Ctrl-C
> leads to
> >> System error:
>
> Interactive interrupt at #x7FABD2204D2F.
> (1) -> ^[[>65;6800;1c^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^Xc^X

Idem.

> That is probably a problem in FriCAS sman redirecting I/O appropriately.
>
> Starting "fricas -nosman" seems to start emacs as it should, though.

Personally on top of CCL it starts as it should, yes, but Ctrl-X
Ctrl-C leads to an infinite loop with output:
(1) ->
>> System error:
on #<BASIC-CHARACTER-INPUT-STREAM UTF-8 (TTY/0) #x30200083CEFD> :
Input/output error during read

(1) ->
>> System error:
on #<BASIC-CHARACTER-INPUT-STREAM UTF-8 (TTY/0) #x30200083CEFD> :
Input/output error during read

(1) ->
>> System error:
on #<BASIC-CHARACTER-INPUT-STREAM UTF-8 (TTY/0) #x30200083CEFD> :
Input/output error during read

(1) ->
>> System error:
on #<BASIC-CHARACTER-INPUT-STREAM UTF-8 (TTY/0) #x30200083CEFD> :
Input/output error during read


>
> Ralf
>
> --
> 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/7b730f2d-9d16-105e-0527-d3f5db893c3d%40hemmecke.org.
Reply all
Reply to author
Forward
0 new messages