[erlang-questions] erlang-questions Digest, Vol 24, Issue 15

Alpár Jüttner <>
Tue May 5 13:11:08 CEST 2009


> > when Erlang is a clearly OO language.  The "This isn't the right place" 
> > argument doesn't work on this list even when it's correct.  Don't shoot 
> > other people's questions down like this.
> 
> Sorry, but the original answer was absolutely correct.

I wouldn't say that.

You posted an longish and angry discussion how these tasks can be done
using control sequences. That is good (and indeed not really on-topic
here).

But you remained silent about the obvious question of how to send these
control sequences to the terminal. It fits perfectly the topic of this
list. Could you tell us the answer for this, too?

Regards,
Alpar


>  You just don't 
> know at all what you are talking about. And going on a rant about it 
> don't change that.
> 
> Even getting colors is something that is totally dependant on what kind 
> of terminal (yes, *terminal*) you have. Using a window on a windowing 
> system (such as Microsoft Windows or X-windows, or whatever) means that 
> you have a terminal program running, which do the actual visualization.
> 
> *Erlang is in no way involved with this.*
> 
> However, almost all terminal programs have some way of controlling them, 
> and thus cause visual effects. The exact way you get the terminal 
> program to present the visual effects you want is possibly unique for 
> that terminal program. And it is still totally outside of Erlang.
> All that being said, there is an ANSI standard, which many terminal 
> programs implement, which means that if your terminal program follows 
> this standard, the way to get the wanted effects are well known, and can 
> probably be answered by a whole bunch of people reading this list.
> But this is still a question of how to control a terminal, and not a 
> question about Erlang. But even so, we don't even know what kind of 
> terminal the original posted is using, so we can't even make a proper 
> answer based on that standard, because it might very well not be 
> something that will work for him.
> 
> Sorry, but you uninformed reply really pissed me off. Uninformed people 
> are not a problem. We all have to learn somehow, someway, at some point.
> But making totally bogus claims, and trying to shoot down someone who 
> gives a correct answer is just plain wrong. *First* you learn the topic, 
> *then* you answer. Not the other way around.
> 
> To make things clear, exactly this same question pops up in all kind of 
> mailing lists, for all kind of subjects. And for some totally unkown 
> reason (to me), you think that it is Erlang that should have the answer. 
> Geez. Maybe I should direct all the people on NetBSD-current here as 
> well, when they pop this question.
> 
> 
> And, as a friendly gnome, I'll provide the answer for when he really is 
> using a terminal that is ANSI compliant:
> 
> To clear the screen, you send the sequence
> CSI n J
> 
> And to move the cursor, you send the sequence
> CSI y ; x H
> 
> CSI is an eight bit character, with the octal code of 233. A seven bit 
> replacement is the string ESC [.
> The n argument in the CSI n J sequence can be:
> 0 - Clear from cursor to end of screen
> 1 - Clear from beginning of screen to cursor
> 2 - Clear whole screen
> 
> The default, if no argument is given, is 0.
> 
> The cursor movement have 1,1 as the top left corner. If the arguments 
> are omitted, it is the same as moving to (1,1)
> 
> So, by sending the sequence CSI H CSI J, you'll move the cursor to the 
> top left, and clear the screen.
> With seven bit controls, you'd send ESC [ H ESC [ J
> 
> Note that I have a space between each character sent, for readability. 
> CSI(233) is one character, so is ESC(33).
> 
> I could go on for quite a while about this, but maybe you should read a 
> manual instead?
> 
> And this is still totally not related to Erlang, and you'd send the same 
> control sequence if your program was written in C, Perl, Haskell, Lisp, 
> Prolog, Assembler, Basic, Pascal, FORTRAN, Cobol, Snobol, Algol, Dibol, 
> Focal, Python, Java, or God knows what else, if your *terminal* was ANSI 
> compliant.
> If that shouldn't make it obvious to you that it is not related to the 
> language, but to the terminal, then I don't know what would.
> 
> Now, if the question instead would have been "how do I create a CSI H 
> CSI J string in Erlang?", then we're in business.
> 
> 	Johnny
> 




More information about the erlang-questions mailing list