Le dimanche 8 août 2021, 14:57:42 UTC Bastien Roucariès a écrit : > Le dimanche 8 août 2021, 10:04:30 UTC Benno Schulenberg a écrit : > > > $env -i nano > > > command fail because TERM is unset > > > > I can work around an unset TERM. But what if TERM=="" or > > TERM=="nonsense"? > > Checking whether TERM is a valid terminal name goes too far, in my > > opinion. > > > > Also, is the 'vt100' terminal description guaranteed to exist? I ask, > > because 'dumb' and 'vt52' are not good enough for nano (ncurses) to work > > properly, and 'ansi' leaves the cursor invisible on a VTE-based terminal. > > I do not know but I think the only sensible way to behave is like vi under > POSIX (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html): > TERM > Determine the name of the terminal type. If this variable is unset or > null, an unspecified default terminal type shall be used. > > The other way are broken.
I should add if term is not supported failling with exit code 126 will help. > > > Benno
signature.asc
Description: This is a digitally signed message part.