unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Device 0 is not a termcap terminal device
@ 2008-09-24 17:55 csant
  2008-10-03 10:07 ` Alan Mackenzie
  0 siblings, 1 reply; 19+ messages in thread
From: csant @ 2008-09-24 17:55 UTC (permalink / raw)
  To: emacs-devel

Hi,

I am very glad we recently got the --daemon option.  I am having a little  
trouble with it, though.  When starting
	$ emacs --daemon
and then attaching an emacsclient with
	$ emacsclient -t <file>
I get the following message:


An error has occurred while loading `/home/csant/.emacs':

error: Device 0 is not a termcap terminal device

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.


When I however start emacs with said flag, everything goes smooth.  Also,  
when starting emacs in non-daemon mode, I get no messages.  I am puzzled,  
and wondering what other ways there are for me to see what actually goes  
wrong in the init, short of just dumping my whole ~/.emacs here…

Suggestions appreciated.

/c





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2008-09-24 17:55 Device 0 is not a termcap terminal device csant
@ 2008-10-03 10:07 ` Alan Mackenzie
  2008-10-03 16:14   ` Chong Yidong
  2008-10-03 16:25   ` Dan Nicolaescu
  0 siblings, 2 replies; 19+ messages in thread
From: Alan Mackenzie @ 2008-10-03 10:07 UTC (permalink / raw)
  To: csant; +Cc: emacs-devel

Hi,

On Wed, Sep 24, 2008 at 07:55:13PM +0200, csant wrote:
> Hi,
 
> I am very glad we recently got the --daemon option.  I am having a little  
> trouble with it, though.  When starting
> 	$ emacs --daemon
> and then attaching an emacsclient with
> 	$ emacsclient -t <file>
> I get the following message:


> An error has occurred while loading `/home/csant/.emacs':

> error: Device 0 is not a termcap terminal device

> To ensure normal operation, you should investigate and remove the
> cause of the error in your initialization file.  Start Emacs with
> the `--debug-init' option to view a complete error backtrace.


> When I however start emacs with said flag, everything goes smooth.  Also,  
> when starting emacs in non-daemon mode, I get no messages.  I am puzzled,  
> and wondering what other ways there are for me to see what actually goes  
> wrong in the init, short of just dumping my whole ~/.emacs here???

> Suggestions appreciated.

No suggestions, but a "me too".  I've just updated and rebuilt Emacs-23,
and with this command:

    $ ~/emacs/emacs/src/emacs -batch -l 000tests.el -f do-all-tests

(i.e., run the CC Mode test suite),  I get the same error message,
namely:

    Device 0 is not a termcap terminal device

.  This is distressing.  It also suggests the error is nothing to do with
--daemon, but perhaps more to do with ttys.  The error happens both on a
Linux tty and an X-Windows term.

> /c

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2008-10-03 10:07 ` Alan Mackenzie
@ 2008-10-03 16:14   ` Chong Yidong
  2008-10-04 22:27     ` Alan Mackenzie
  2008-10-03 16:25   ` Dan Nicolaescu
  1 sibling, 1 reply; 19+ messages in thread
From: Chong Yidong @ 2008-10-03 16:14 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: csant, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> No suggestions, but a "me too".  I've just updated and rebuilt Emacs-23,
> and with this command:
>
>     $ ~/emacs/emacs/src/emacs -batch -l 000tests.el -f do-all-tests
>
> (i.e., run the CC Mode test suite),  I get the same error message,
> namely:
>
>     Device 0 is not a termcap terminal device
>
> .  This is distressing.  It also suggests the error is nothing to do with
> --daemon, but perhaps more to do with ttys.  The error happens both on a
> Linux tty and an X-Windows term.

Could you find out when the problem first showed up?




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2008-10-03 10:07 ` Alan Mackenzie
  2008-10-03 16:14   ` Chong Yidong
@ 2008-10-03 16:25   ` Dan Nicolaescu
  2009-09-01 20:08     ` Alan Mackenzie
  1 sibling, 1 reply; 19+ messages in thread
From: Dan Nicolaescu @ 2008-10-03 16:25 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: csant, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

  > Hi,
  > 
  > On Wed, Sep 24, 2008 at 07:55:13PM +0200, csant wrote:
  > > Hi,
  >  
  > > I am very glad we recently got the --daemon option.  I am having a little  
  > > trouble with it, though.  When starting
  > > 	$ emacs --daemon
  > > and then attaching an emacsclient with
  > > 	$ emacsclient -t <file>
  > > I get the following message:
  > 
  > 
  > > An error has occurred while loading `/home/csant/.emacs':
  > 
  > > error: Device 0 is not a termcap terminal device

I fixed this a few days ago, someone reported it on bug-gnu-emacs.

  > No suggestions, but a "me too".  I've just updated and rebuilt Emacs-23,
  > and with this command:
  > 
  >     $ ~/emacs/emacs/src/emacs -batch -l 000tests.el -f do-all-tests
  > 
  > (i.e., run the CC Mode test suite),  I get the same error message,
  > namely:
  > 
  >     Device 0 is not a termcap terminal device
  > 
  > .  This is distressing.  It also suggests the error is nothing to do with
  > --daemon, but perhaps more to do with ttys.  The error happens both on a
  > Linux tty and an X-Windows term.

This is very strange, the code that prints the message in question is in
init_display. init_display gets called like this:

  if (!noninteractive)
    init_display ();    /* Determine terminal type.  Calls

-batch means !noninteractive is false ... 





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2008-10-03 16:14   ` Chong Yidong
@ 2008-10-04 22:27     ` Alan Mackenzie
  2009-02-04 22:45       ` moboyle79
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Mackenzie @ 2008-10-04 22:27 UTC (permalink / raw)
  To: Chong Yidong; +Cc: csant, Dan Nicolaescu, emacs-devel

Hi, Yidong!

On Fri, Oct 03, 2008 at 12:14:32PM -0400, Chong Yidong wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > No suggestions, but a "me too".  I've just updated and rebuilt Emacs-23,
> > and with this command:

> >     $ ~/emacs/emacs/src/emacs -batch -l 000tests.el -f do-all-tests

> > (i.e., run the CC Mode test suite),  I get the same error message,
> > namely:

> >     Device 0 is not a termcap terminal device

> > .  This is distressing.  It also suggests the error is nothing to do with
> > --daemon, but perhaps more to do with ttys.  The error happens both on a
> > Linux tty and an X-Windows term.

> Could you find out when the problem first showed up?

I've tried.  My first idea was to download the Emacs head at various
dates, starting 64 days ago, and do a binary chop from there.  It didn't
quite work out like that.

I downloaded each version of the head like this:

    $ cvs checkout -D 2008-08-01 emacs

in a separate directory, then configured and built thusly:

    $ ./configure   --with-gif=no --with-tiff=no
    $ make bootstrap

Here're my results:

Friday 2008-08-01 (64 days ago): Got the error message "Device 0 is not a
  termcap terminal device".

Thursday 2008-05-29 (128 days ago): Got a build error:
  "make[1]: *** No rule to make target
  `/home/acm/emacs/emacs-290508/emacs/src/../lisp/help.elc', needed by `../etc/DOC'.
  Stop."

Monday 2008-06-30 (96 days ago): Got the same error message "Device 0
  ...".  Incidentally, got a seg fault during building several times,
  each time restarting with "make".

Wednesday 2008-03-26 (192 days ago): Same error message "Device 0 ....".

Sunday 2007-09-16 (384 days ago): Got a (possibly different) error
  message "Unknown terminal device".

Friday 2007-06-08, Friday 2007-06-15: Got build failures each time.

[Perhaps relevant here is that Emacs 22.1 was released on Monday
2007-06-04.]

So I'm not particularly close to tracking down the critical date.  Each
iteration is taking me a little over half an hour, so it's a fairly
arduous process.  Either I'm doing something stupid in my test suite, or
there's a bug which has been around since shortly after Emacs 22 was
released.  My test suite works fine in Emacs 22.x.

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2008-10-04 22:27     ` Alan Mackenzie
@ 2009-02-04 22:45       ` moboyle79
  2009-02-05  7:15         ` Dan Nicolaescu
  0 siblings, 1 reply; 19+ messages in thread
From: moboyle79 @ 2009-02-04 22:45 UTC (permalink / raw)
  To: Emacs-devel


I don't have much to add, except that I fix the problem by commenting out the
line
  (xterm-mouse-mode t)
in my ~/.emacs .  As another note, when the daemon is running, and I
`emacsclient -nw` and try to run the command xterm-mouse-mode, I get "Device
0 is not a termcap terminal device" in the minibuffer.

I have emacs 23.0.90.1 on red hat.
-- 
View this message in context: http://www.nabble.com/Device-0-is-not-a-termcap-terminal-device-tp19654468p21841402.html
Sent from the Emacs - Dev mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-02-04 22:45       ` moboyle79
@ 2009-02-05  7:15         ` Dan Nicolaescu
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Nicolaescu @ 2009-02-05  7:15 UTC (permalink / raw)
  To: moboyle79; +Cc: Emacs-devel

moboyle79 <moboyle79@hotmail.com> writes:

  > I don't have much to add, except that I fix the problem by commenting out the
  > line
  >   (xterm-mouse-mode t)
  > in my ~/.emacs .  As another note, when the daemon is running, and I
  > `emacsclient -nw` and try to run the command xterm-mouse-mode, I get "Device
  > 0 is not a termcap terminal device" in the minibuffer.

I checked in a fix for this.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2008-10-03 16:25   ` Dan Nicolaescu
@ 2009-09-01 20:08     ` Alan Mackenzie
  2009-09-01 21:31       ` Andreas Schwab
  2009-09-01 23:20       ` Stefan Monnier
  0 siblings, 2 replies; 19+ messages in thread
From: Alan Mackenzie @ 2009-09-01 20:08 UTC (permalink / raw)
  To: emacs-devel; +Cc: csant

Hi Emacs!

A little less that a year ago, I supplied a "me too" to this bug in which
batch programs would crash with the error message

    Device 0 is not a termcap terminal device

I have now tracked this bug down: `send-string-to-terminal' crashes in
-batch.  To see this, compare the following:

$ emacs-23.1 -Q -batch -eval '(send-string-to-terminal "Hello, world!\n")'
Device 0 is not a termcap terminal device

$ emacs-22.3 -Q -batch -eval '(send-string-to-terminal "Hello, world!\n")'
Hello, world!

Comparing the old and new versions of dispnew.c, Fsend_string_to_terminal
has been extensively modified.  Emacs-22 just did this:

    fwrite (SDATA (string), 1, SBYTES (string), stdout);

, Emacs-23 has tarted this up (for multi-tty, maybe?) with code including
this:

    tty = t->display_info.tty;

.  It is this function with throws the error.  It seems that batch mode
was overlooked when this change was made.

The CC Mode test suite uses `send-string-to-terminal' in batch mode to
display the names of test files on a single line without scrolling.  It
is of some inconvenience to me not being able to run the test suite in
Emacs-23.

Would somebody who knows this code (Dan N?) please fix this soon.  I
WOULD APPRECIATE A PATCH VERY QUICKLY!!!!

Thanks in advance!

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-01 20:08     ` Alan Mackenzie
@ 2009-09-01 21:31       ` Andreas Schwab
  2009-09-01 22:27         ` Alan Mackenzie
  2009-09-01 23:20       ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Andreas Schwab @ 2009-09-01 21:31 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: csant, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> The CC Mode test suite uses `send-string-to-terminal' in batch mode

This is your problem.  Use princ instead.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-01 21:31       ` Andreas Schwab
@ 2009-09-01 22:27         ` Alan Mackenzie
  2009-09-01 22:36           ` Andreas Schwab
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Mackenzie @ 2009-09-01 22:27 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: csant, emacs-devel

Good evening, Andreas!

On Tue, Sep 01, 2009 at 11:31:53PM +0200, Andreas Schwab wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > The CC Mode test suite uses `send-string-to-terminal' in batch mode

> This is your problem.

Do you mean that `send-string-to-terminal' shouldn't have to work in
batch mode?

The documentation of the function in the Elisp manual for Emacs 22 just
said that the string is sent to "the terminal", which presumable means
stdout.  

In Emacs 23's Elisp, it says the string goes to "the selected frame's
terminal", which is clearly undefined in batch mode.

This change wasn't in the "incompatible changes" section of NEWS, so it
would appear to be a bug.

> Use princ instead.

This doesn't work.  In place of the smoothly updating line produced by
send-string-to-terminal, princ sputters, leaves the line partially
blank, updating fragments of it every few seconds.

princ is the wrong function - it's purpose is to convert lisp objects to
human reabable strings, so it'll be doing something wierd with the
control characters in the output strings, or buffering them
inappropriately, or whatever.

The strings being output are terminal specific, therefore they need an
"raw output to terminal" function, such as send-string-to-terminal.  I
think I was right.  :-)

> Andreas.

-- 
Alan Mackenzie (Nürnberg).




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-01 22:27         ` Alan Mackenzie
@ 2009-09-01 22:36           ` Andreas Schwab
  2009-09-01 23:02             ` Alan Mackenzie
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Schwab @ 2009-09-01 22:36 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: csant, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> princ is the wrong function - it's purpose is to convert lisp objects to
> human reabable strings, so it'll be doing something wierd with the
> control characters in the output strings,

No, it doesn't.  It works like princ is supposed to work.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-01 22:36           ` Andreas Schwab
@ 2009-09-01 23:02             ` Alan Mackenzie
  2009-09-02  9:14               ` Andreas Schwab
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Mackenzie @ 2009-09-01 23:02 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: csant, emacs-devel

Good early morning!

On Wed, Sep 02, 2009 at 12:36:53AM +0200, Andreas Schwab wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > princ is the wrong function - it's purpose is to convert lisp objects
> > to human reabable strings, so it'll be doing something wierd with the
> > control characters in the output strings,

> No, it doesn't.  It works like princ is supposed to work.

I don't doubt that.  However, it doesn't work in the CC Mode test suite,
whereas send-string-to-terminal does.  Or, rather, did.

I suspect Barry Warsaw, the original author of 000tests.el, tried princ
at first, couldn't get it working, and then put send-string-to-terminal
in in its place.  Or, possibly, wrote send-string-to-terminal for that
purpose.  It was a long time ago.

Thanks for the suggestion anyhow.

> Andreas.

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-01 20:08     ` Alan Mackenzie
  2009-09-01 21:31       ` Andreas Schwab
@ 2009-09-01 23:20       ` Stefan Monnier
  2009-09-02  9:43         ` Alan Mackenzie
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2009-09-01 23:20 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: csant, emacs-devel

> A little less that a year ago, I supplied a "me too" to this bug in which
> batch programs would crash with the error message

>     Device 0 is not a termcap terminal device

> I have now tracked this bug down: `send-string-to-terminal' crashes in
> -batch.  To see this, compare the following:

Does the patch below help?

> The documentation of the function in the Elisp manual for Emacs 22
> just said that the string is sent to "the terminal", which presumable
> means stdout.

There's a subtle difference between the two, but yes, they used to be
pretty much the same.  With multi-tty, the difference is made
more significant.

> In Emacs 23's Elisp, it says the string goes to "the selected frame's
> terminal", which is clearly undefined in batch mode.

Actually, it is well defined: when Emacs starts it starts with a special
frame on a special terminal (a dumb terminal), later on, this terminal
is usually deleted and replaced with an X11 or tty terminal, except in
batch mode and in daemon mode.  Look for the `terminal-frame' variable
and its uses in startup.el and frame.el to see it in action.

> This change wasn't in the "incompatible changes" section of NEWS, so it
> would appear to be a bug.

send-string-to-terminal is rarely used, and even more so in batch mode
(where you could argue that it worked by accident).  That's why nobody
noticed the problem (and neither decided to fix it nor to document it).


        Stefan


=== modified file 'src/dispnew.c'
--- src/dispnew.c	2009-08-26 02:42:52 +0000
+++ src/dispnew.c	2009-09-01 23:09:31 +0000
@@ -6090,8 +6090,9 @@
      Lisp_Object string;
      Lisp_Object terminal;
 {
-  struct terminal *t = get_tty_terminal (terminal, 1);
+  struct terminal *t = get_terminal (terminal, 1);
   struct tty_display_info *tty;
+  FILE *out;
 
   /* ??? Perhaps we should do something special for multibyte strings here.  */
   CHECK_STRING (string);
@@ -6100,6 +6101,12 @@
   if (!t)
     error ("Unknown terminal device");
 
+  if (t->type == output_initial)
+    out = stdout;
+  else if (t->type != output_termcap && t->type != output_msdos_raw)
+    error ("Device %d is not a termcap terminal device", t->id);
+  else
+    {
   tty = t->display_info.tty;
 
   if (! tty->output)
@@ -6110,8 +6117,10 @@
       fwrite (SDATA (string), 1, SBYTES (string), tty->termscript);
       fflush (tty->termscript);
     }
-  fwrite (SDATA (string), 1, SBYTES (string), tty->output);
-  fflush (tty->output);
+      out = tty->output;
+    }
+  fwrite (SDATA (string), 1, SBYTES (string), out);
+  fflush (out);
   UNBLOCK_INPUT;
   return Qnil;
 }





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-01 23:02             ` Alan Mackenzie
@ 2009-09-02  9:14               ` Andreas Schwab
  2009-09-02  9:57                 ` Alan Mackenzie
  0 siblings, 1 reply; 19+ messages in thread
From: Andreas Schwab @ 2009-09-02  9:14 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: csant, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> I don't doubt that.  However, it doesn't work in the CC Mode test suite,

Please define "doesn't work".

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-01 23:20       ` Stefan Monnier
@ 2009-09-02  9:43         ` Alan Mackenzie
  2009-09-02 17:48           ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Mackenzie @ 2009-09-02  9:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: csant, emacs-devel

Hi, Stefan!

On Tue, Sep 01, 2009 at 07:20:01PM -0400, Stefan Monnier wrote:
> > A little less that a year ago, I supplied a "me too" to this bug in which
> > batch programs would crash with the error message

> >     Device 0 is not a termcap terminal device

> > I have now tracked this bug down: `send-string-to-terminal' crashes in
> > -batch.  To see this, compare the following:

> Does the patch below help?

Yes, wonderfully!  Thank you very much!

Would you like me to make a proper patch (including changing the doc
string and the elisp page) out of this?

> > The documentation of the function in the Elisp manual for Emacs 22
> > just said that the string is sent to "the terminal", which presumably
> > means stdout.

> There's a subtle difference between the two, but yes, they used to be
> pretty much the same.  With multi-tty, the difference is made more
> significant.

> > In Emacs 23's Elisp, it says the string goes to "the selected frame's
> > terminal", which is clearly undefined in batch mode.

> Actually, it is well defined: when Emacs starts it starts with a special
> frame on a special terminal (a dumb terminal), later on, this terminal
> is usually deleted and replaced with an X11 or tty terminal, except in
> batch mode and in daemon mode.  Look for the `terminal-frame' variable
> and its uses in startup.el and frame.el to see it in action.

> > This change wasn't in the "incompatible changes" section of NEWS, so it
> > would appear to be a bug.

> send-string-to-terminal is rarely used, and even more so in batch mode
> (where you could argue that it worked by accident).  That's why nobody
> noticed the problem (and neither decided to fix it nor to document it).

Well, whether it worked by accident or design in batch mode, it's useful.
:-)

Funny thing is: running 000test.el has flagged up some CC Mode bugs which
weren't bugs in Emacs 22.  More work.  :-(

Thanks again!

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-02  9:14               ` Andreas Schwab
@ 2009-09-02  9:57                 ` Alan Mackenzie
  2009-09-02 10:11                   ` Andreas Schwab
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Mackenzie @ 2009-09-02  9:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel

Hi, Andreas!

On Wed, Sep 02, 2009 at 11:14:51AM +0200, Andreas Schwab wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > I don't doubt that.  However, it doesn't work in the CC Mode test
> > suite,

> Please define "doesn't work".

Sorry, bad phraseology.  I meant it doesn't do what the test program needs.
Basically, it's not the right function for the job.  More specifically,
the test program outputs lines on the screen looking like this:

    Testing arglist-19.c (syntax)

, but displays them "on top" of eachother, so that the stuff on the
screen doesn't scroll upwards, which would be unhelpful.  Only when it
finds errors (which of course happens only rarely ;-) does it scroll,
then it carries on displaying the "testing <filename> (..)" lines as
before.

When I tried `princ' in place of `send-string-to-terminal', the
displaying of these lines was broken.  Typically, the line would look
something like:

            arg    -1       ntax)

, with the cursor jumping madly over it, the actual contents being
updated every 2 or 3 seconds.  This is on a Linux virtual terminal.

Stefan's patch has made `send-string-to-terminal' work again in batch
mode.

> Andreas.

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-02  9:57                 ` Alan Mackenzie
@ 2009-09-02 10:11                   ` Andreas Schwab
  0 siblings, 0 replies; 19+ messages in thread
From: Andreas Schwab @ 2009-09-02 10:11 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> When I tried `princ' in place of `send-string-to-terminal', the
> displaying of these lines was broken.  Typically, the line would look
> something like:
>
>             arg    -1       ntax)
>
> , with the cursor jumping madly over it, the actual contents being
> updated every 2 or 3 seconds.  This is on a Linux virtual terminal.

So the issue seems to be that stdout is line buffered and there is no
way to flush the output beyond that.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-02  9:43         ` Alan Mackenzie
@ 2009-09-02 17:48           ` Stefan Monnier
  2009-09-11 20:36             ` Alan Mackenzie
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2009-09-02 17:48 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: csant, emacs-devel

>> > A little less that a year ago, I supplied a "me too" to this bug in which
>> > batch programs would crash with the error message

>> >     Device 0 is not a termcap terminal device

>> > I have now tracked this bug down: `send-string-to-terminal' crashes in
>> > -batch.  To see this, compare the following:

>> Does the patch below help?

> Yes, wonderfully!  Thank you very much!

> Would you like me to make a proper patch (including changing the doc
> string and the elisp page) out of this?

Please do,


        Stefan




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Device 0 is not a termcap terminal device
  2009-09-02 17:48           ` Stefan Monnier
@ 2009-09-11 20:36             ` Alan Mackenzie
  0 siblings, 0 replies; 19+ messages in thread
From: Alan Mackenzie @ 2009-09-11 20:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: csant, emacs-devel

Hi, Stefan,

On Wed, Sep 02, 2009 at 01:48:38PM -0400, Stefan Monnier wrote:
> >> > A little less that a year ago, I supplied a "me too" to this bug in which
> >> > batch programs would crash with the error message

> >> >     Device 0 is not a termcap terminal device

> >> > I have now tracked this bug down: `send-string-to-terminal' crashes in
> >> > -batch.  To see this, compare the following:

> >> Does the patch below help?

> > Yes, wonderfully!  Thank you very much!

> > Would you like me to make a proper patch (including changing the doc
> > string and the elisp page) out of this?

> Please do,

OK, I was a bit slow and you committed the code change.  I've just
committed patches for `send-string-to-terminal''s doc string (dispnew.c)
and the right bit in .../lispref/os.texi.

Shouldn't these be in the Emacs 23 bug fix branch too?

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-09-11 20:36 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-24 17:55 Device 0 is not a termcap terminal device csant
2008-10-03 10:07 ` Alan Mackenzie
2008-10-03 16:14   ` Chong Yidong
2008-10-04 22:27     ` Alan Mackenzie
2009-02-04 22:45       ` moboyle79
2009-02-05  7:15         ` Dan Nicolaescu
2008-10-03 16:25   ` Dan Nicolaescu
2009-09-01 20:08     ` Alan Mackenzie
2009-09-01 21:31       ` Andreas Schwab
2009-09-01 22:27         ` Alan Mackenzie
2009-09-01 22:36           ` Andreas Schwab
2009-09-01 23:02             ` Alan Mackenzie
2009-09-02  9:14               ` Andreas Schwab
2009-09-02  9:57                 ` Alan Mackenzie
2009-09-02 10:11                   ` Andreas Schwab
2009-09-01 23:20       ` Stefan Monnier
2009-09-02  9:43         ` Alan Mackenzie
2009-09-02 17:48           ` Stefan Monnier
2009-09-11 20:36             ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).