>> 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
Nano will "run" in any terminal, but the user (or rather: the system) /must/ specify the terminal. There does not seem to be a way for a program to probe which terminal is being used. > 2 filter the bad terminal and return with an unambigous error code Emacs filters out 'dumb' because a dumb terminal cannot position the cursor and emacs (and nano) need to be able to position the cursor. But how can nano in general determine whether a given terminal is able to position the cursor? Lacking that, I do not see any reason to try and filter out "bad" terminals. If the user wants to be dumb and set TERM to 'dumb', they will get what they asked for. Vim does not filter out 'dumb' either, and becomes unusable too in that case. > You do not implement a consistant behavior. Are you accusing me? Please watch your language. >> May I ask what the scenario is? How can it happen that TERM is unset? >> What disaster can leave TERM unset? You didn't answer the question. > 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. Who says that nano wants to be a replacement for vi? Benno
OpenPGP_signature
Description: OpenPGP digital signature