Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

problem: emacs interactive shell and cpan

by stefp (Vicar)
on Dec 05, 2001 at 19:46 UTC ( #129630=perlquestion: print w/replies, xml ) Need Help??
stefp has asked for the wisdom of the Perl Monks concerning the following question:

When installing a module with cpan, the resulting tests expect a real ANSI terminal and the interactive shell mode is not. As a result the ^M that should wrap to the begining of the line is printed and the next test output is appended instead of replacing the previous one. As a result,the buffer is littered with tests results.

The good news is that there is some hook to do filtering. It is used by M-x ansi-color-for-comint-mode-on which looks fine. Has someone written a filter that does the right thing with ^M. It should be easy to write for a elisp master but I am just a elisp hater. Help!

A second look shows that to be perfect one should implement one of the ANSI cursor move.

-- stefp

  • Comment on problem: emacs interactive shell and cpan

Replies are listed 'Best First'.
Re: problem: emacs interactive shell and cpan
by stefan k (Curate) on Dec 05, 2001 at 20:51 UTC
    This is a well known problem. A quick glance at the newsgroup finds some things:
    • Use the tshell
    • Set up correct terminfo (and hope that the program you use looks at it).
    • Have a look at the eterm package in your distribution (I'm not sure if this is XEmacs only). This package contains the tshell and the doc says it's a realy ANSI terminal: * Uses standard ANSI (vt102) escape sequences.
    • Here is a longer discussion of the topic.
    Good Luck!

    Regards... Stefan
    you begin bashing the string with a +42 regexp of confusion

Re: problem: emacs interactive shell and cpan
by clemburg (Curate) on Dec 05, 2001 at 22:43 UTC

    I am not sure if I understand you right, but for a similar problem I used this little snippet for XEmacs:

    ;; stop ^M from appearing in shell window (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t)

    Christian Lemburg
    Brainbench MVP for Perl

      I assumed wrongly that the problem was both with emacs and xemacs and used emacs as the generic term. But emacs works as I want while xemacs does not. So all what I said before and below do apply only for xemacs

      What I want is ^M to wrap the caret to the beginning of the line, so that the material that come after the ^M overwrites the previous material. Anyway the code of shell-strip-ctrl-m is certainly a good starting point. Thanks.

      -- stefp

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://129630]
[Corion]: thezip: start "some title" path\to\that\ application, but that will open another console window
[Corion]: thezip: If you want to confuse your users, use system(1, "that\\command" );, which will make Perl launch it in the background
[Corion]: That will keep the console window open even though the user can't type into it anymore
[thezip]: So I have a script that generates a log file. After script completion, I want tohave VIM open this logfile.
[thezip]: i don't get the command line "back" until I close VIM. No what I want to happen...
[thezip]: I currently don't have access to CYGWIN, else I'd just do a tail -f on the logfile.
[Corion]: thezip: If you want to open vim and can live with opening a second console window, use start "The results" vim.exe c:\path\to\logfile .log

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2017-03-27 18:52 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (321 votes). Check out past polls.