emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read a reply from the terminal


From: Andreas Schwab
Subject: Re: read a reply from the terminal
Date: Sun, 15 Jul 2007 10:18:51 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux)

Dan Nicolaescu <address@hidden> writes:

> !       ;; Try to find out the type of terminal by sending a "Secondary
> !       ;; Device Attributes (DA)" query.
> !       (send-string-to-terminal "\e[>0c")
> ! 
> !       ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; 
> NUMBER3 c
> !       (when (equal (read-event) ?\e)

> !     (when (equal (read-event) 91)
> !       (while (not (equal (setq chr (read-event)) ?c))
> !         (setq str (concat str (string chr))))

What if the terminal is ignoring the query, or there is some other
communication problem, wouldn't that mean that read-event would hang
here?  IMHO the calls should use the timeout feature.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]