Le mardi 10 août 2021, 08:05:00 UTC Benno Schulenberg a écrit :
> Op 09-08-2021 om 15:08 schreef Bastien Roucariès:
> > nano work with TERM=dumb (but is strange but it work),
> 
> For me, 'TERM=dumb nano somefile' does not work, not on a console, not
> on an xterm, not on Xfce Terminal -- it shows something, but is totally
> unusable: the user cannot see what he or she is doing.  What terminal
> are you using?

Yes but it run, it is unusable but it run. The problem is the behvior is not 
consistant. You have only two sane choice:
1 allow to run in every terminal. It is user choice and it could shot it own 
foot
2 filter the bad terminal and return with an unambigous error code because I 
could not initialize(like 156 faking could not execute due to library not here 
or even 155 is it is documented)

You do not implement a consistant behavior.
> 
> > so safer will be to
> > consider as best effort TERM="" , TERM not set, equivalent to dumb.
> 
> May I ask what the scenario is?  How can it happen that TERM is unset?
> What disaster can leave TERM unset?  When the user starts a shell with
> 'env -i' and does not know how to get out?
> 
> I think it is okay when nano works around an unset TERM, simply because
> nano /needs/ a terminal.  But if TERM is set to anything that is invalid
> (even the empty string), then the user is responsible and they should get
> what they asked for -- that is: a non-functioning nano.

No posix said about vi that the behavior for empty term should be consistant 
and documented. If nano want to be a vi replacement it should be consistant.

You could implement 2 (fine) but please be consistant refuse dumb, vt52 and 
other impossible terminal with error code that say nano could not initialize 
(thus allowing to test if they are an error during reading/writting a file and 
nano could not run, please try another editor)

Bastien

> 
> Benno

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to