[Top][All Lists]

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

telnet-filter and comint-output-filter-functions

From: Alex Schroeder
Subject: telnet-filter and comint-output-filter-functions
Date: 24 Apr 2001 00:58:52 +0200
User-agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/20.7

In GNU Emacs 20.7.1 (i686-pc-linux-gnu, X toolkit)
 of Sun Apr  8 2001 on snail

telnet is based on comint-mode, and as such it should honor
comint-mode conventions wherever possible.  The following following
bug requires a change in telnet-filter, I think:

When a user uses shell-mode and types ls --color=yes, the output is
garbled with SGR control sequences (ansi escape sequences).  The user
may therefore load ansi-color.el.  This will run the following:

(add-hook 'comint-output-filter-functions

The user may then run M-x ansi-color-for-comint-mode-on, which will
cause ansi-color-process-output to actually do something.

In shell mode, this is what I see when examining
comint-output-filter-functions, and everything is working fine:

comint-output-filter-functions's value is 

Local in buffer *shell*; global value is 
(ansi-color-process-output comint-postoutput-scroll-to-bottom)

The same is not true for M-x telnet, and that is a bug.  The value of
comint-output-filter-functions is the same, but it has a disturbing
effect.  If it had no effect, then that would be a simple bug:

telnet-initial-filter is the first process-filter.  Later, the
process-filter is changed to telnet-filter.  And telnet-filter does
not do what comint-output-filter does at the very end:

          (narrow-to-region obeg oend)
          (goto-char opoint)
          (run-hook-with-args 'comint-output-filter-functions string))))))

Maybe adding that helps solve the problem.  Unfortunately it doesn't
just "not work" -- when I run M-x telnet and connect to my local
machine, and type lots of `ls', some of the output will be colored!

Actually, the last chunk that arrived from the process before the
prompt will be colored.

This is how it looks:

prompt> ls
prompt> ls
prompt> ls

Entering ls at this point will color the last piece of garbage, and
add the new (uncolored) output.

Something seems to be very wrong with telnet-filter.


reply via email to

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