🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99834

Inaccurate error message about terminal capabilities

#99834
From: Martin Boyer
Date: Tue, 17 Apr 1990 17:02
70 lines
3005 bytes
On GNU Emacs 18.55.5 of Mon Apr 9 1990 on pellan (berkeley-unix), an
incorrect message is issued whenever emacs is started on a terminal on
which the number of rows and columns is (incorrectly) zero.

% stty columns 0
% stty rows 0
% printenv TERMCAP
sterm:am:bs:bw:km:mi:xo:al=^A:dl=^K:cd=^B:ce=^C:cl=^L:dc=^Y:cr=^M:bl=^G:ta=^I:
im=^Q:ei=^O:cm=^F%d.%d.:le=^H:nd=^S:do=^N:up=^X:ho=^P:ll=^R:sf=^U:sr=^W:md=\Eb:
me=\EE:mr=\Er:se=^T:so=^V:ue=\EU:us=\Eu:
% emacs
emacs: Terminal type "sterm" is not powerful enough to run Emacs.
It lacks the ability to position the cursor.
If that is not the actual type of terminal you have,
use the C-shell command `setenv TERM ...' to specify the correct type.
It may be necessary to do `unsetenv TERMCAP' as well.

The problem is not at all with cursor positioning but with the fact
that the terminal is not properly initialized and that the termcap
entry does not provide a default size.  Agreed, this is hairy, but
with the appearance of xterm, mterm, sterm, etc. this is bound to
happen again.  The message should mention that the problem *could* be
with terminal size, and possibly certify it, by having different
return codes from Wcm_init().

The problem is in term.c:

term_init (terminal_type)
     char *terminal_type;
{
  [...]

  if (Wcm_init ())	/* can't do cursor motion */
    fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
It lacks the ability to position the cursor.\n\
If that is not the actual type of terminal you have,\n\
use the C-shell command `setenv TERM ...' to specify the correct type.\n\
It may be necessary to do `unsetenv TERMCAP' as well.\n",
	   terminal_type);

  [...]
}

and in cm.c:

/*
 * Initialized stuff
 * Return 0 if can do CM.
 */

Wcm_init ()
{
  /* Check that we know the size of the screen.... */
  if (Wcm.cm_rows <= 0 || Wcm.cm_cols <= 0)
    return - 1;
  if (Wcm.cm_abs && !Wcm.cm_ds)
    return 0;
  /* Require up and left, and, if no absolute, down and right */
  if (!Wcm.cm_up || !Wcm.cm_left)
    return - 1;
  if (!Wcm.cm_abs && (!Wcm.cm_down || !Wcm.cm_right))
    return - 1;
  return 0;
}
--
Martin Boyer                         ireq-robot!mboyer@Larry.McRCIM.McGILL.EDU
Institut de recherche d'Hydro-Quebec mboyer@ireq-robot.uucp
Varennes, QC, Canada   J3X 1S1
+1 514 652-8136
Technical Details
Message-ID: <931@s3.ireq.hydro.qc.ca>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!clyde.concordia.ca!s3!gamin

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,4fad4f9ec2462bba,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-04-17 18:22:58 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!clyde.concordia.ca!s3!gamin
From: gamin@ireq-robot.UUCP (Martin Boyer)
Newsgroups: gnu.emacs.bug
Subject: Inaccurate error message about terminal capabilities
Message-ID: <931@s3.ireq.hydro.qc.ca>
Date: 17 Apr 90 17:02:37 GMT
Sender: root@s3.ireq.hydro.qc.ca
Reply-To: gamin@ireq-robot.UUCP (Martin Boyer)
Organization: Laboratoire de robotique, Institut de recherche d'Hydro-Quebec
Lines: 70
Posted: Tue Apr 17 18:02:37 1990