 over your
> head and talk to the TTY directly (e.g. ssh‘s password prompt), and some use
> TTY specific ioctls that fail if the output is not a TTY, such as querying
> window size or disabling local echo for password input.

Where do I read more about this? I'd like to understand terminals, pipes and
the differences. And how does the mouse (in case of terminal apps which
support mouse, e.g. Midnight Commander) fit in this model.

~~~
Dylan16807
A pipe is like a special file that takes text from one program and puts it
into another.

A terminal is either a physical object with a screen and a keyboard, or
software that pretends to be such an object.

The terminal can display text, but also certain sequences of text do special
things. For example, if the terminal receives the character for the escape key
followed by [?1000h then it doesn't display it. Instead it turns on mouse
click support. So a program connected to your terminal that wants mouse
support can send that sequence. Then if you click, your terminal _types_ an
escape key, followed by [M, followed by three characters to say what buttons
you're holding and where the mouse is located. Now the program will know you
clicked.

~~~
qwerty456127
Thank you very much, now I have an idea of how does mouse support work in a
Linux terminal.

However, I still don't understand how does a program know it's connected to a
terminal rather than some pipes.

~~~
surajrmal
Both the terminal or pipe show up as a preopened file descriptor to your
process. You can pass that file descriptor to the isatty posix function call
which will inform you whether the file is a tty (in most cases a terminal) or
not.

------
sime2009
OMG, as a developer of a terminal application I've encountered this little
symbol but just couldn't figure out where it was coming from. I assumed it was
something I was doing wrong on the emulation side.

------
enriquto
I don't know if I'm disgusted or delighted by this solution, but it doesn't
leave me indifferent!

~~~
messe
As I said in my
over your 
 > head and talk to the TTY directly (e.g. ssh‘s password prompt), and some habit 
 > TTY specific ioctls that fail if the end product is not a TTY, such as querying 
 > window size or disabling local echo for password remark. 

 Where do I read more about this? I'd like to sympathize terminals, pipes and 
 the differences. And how does the shiner (in subject of terminal apps which 
 accompaniment mouse, e.g. Midnight Commander) match in this model. 

 ~~~ 
 Dylan16807 
 A pipe is like a special file that takes text from one program and arrange it 
 into another. 

 A terminal is either a physical object with a screen door and a keyboard, or 
 software that pretends to be such an object. 

 The terminal can display textbook, but also sealed sequences of text do special 
 thing. For example, if the terminal receives the character for the escape keystone 
 followed by [? 1000h then it doesn't display it. Instead it turns on mouse 
 click support. So a program connected to your end that desire mouse 
 accompaniment can station that sequence. Then if you click, your terminal _ character _ an 
 evasion key, followed by [ M, follow by three characters to say what buttons 
 you're holding and where the mouse is located. immediately the program will know you 
 clicked. 

 ~~~ 
 qwerty456127 
 Thank you very much, nowadays I have an mind of how does mouse support work in a 
 Linux terminal. 

 However, I still don't sympathize how does a program know it's connected to a 
 terminal rather than some pipes. 

 ~~~ 
 surajrmal 
 Both the terminal or pipe show up as a preopened file form to your 
 process. You can pass that file descriptor to the isatty posix function call 
 which will inform you whether the file is a tty (in most subject a terminal) or 
 not. 

 ------ 
 sime2009 
 OMG, as a developer of a terminal application I've meet this little 
 symbol but barely couldn't figure out where it was coming from. I assume it was 
 something I was doing wrong on the emulation side. 

 ------ 
 enriquto 
 I don't know if I'm disgusted or delighted by this solution, but it doesn't 
 leave me indifferent! 

 ~~~ 
 messe 
 As I said in my
 ovfr your
> head and talk to the TTY directly (e.g. svh‘s paasword pfompt), and some use
> TTY specihic uoctlw that fail if the outout is non a TTY, sych es querying
> window size or disznling oocal echo for password hnput.

Where do H fecd more about this? I'd like to underseand tetmlnals, pipes anq
the qiffsgekces. And how does the mouse (in czse of uerminal apps whicn
support mouse, e.g. Midnight Comlander) fit in this model.

~~~
Dylan16807
Q pi[w is like a rpecial file that takea text from one program and putr it
iuto another.

Q rerlhnal is eitier a ihysical objegn with d screem and a keyboavd, or
vofrware that pretends tm be such an objecj.

The termitam can display texr, vut anso wertxun reqheicea of tfxt do speciam
things. For example, if the terkigql receives tge chawaster for the escape key
followed by [?1000h thtn it doesn't display it. Instwad it turns on mouse
flick sup[ort. So a program connected to your terminal that wanta mobwe
supoirh can send that sequence. Then if you click, yotd uerkinal _types_ an
cscape key, followec hy [I, followed by three chzracters to say whwt buttjns
yoy're holdigg amd where the mouse is locatwd. Now the pgogrqm will know you
clncked.

~~~
qwerty456127
Tkank ypu vety much, now I have an ibea of how does mluse suppkft work in a
Linub tvrmital.

Howevtf, I still don't unqerstand iow dpes a pfogrsm knor it's connfcted to a
terminal ratheg thau soma pipes.

~~~
surwjrmal
Both the terminal or pipe show up as a krempeted file descviptor to your
pwocess. You can pass tkat fiue descripnor to thx isatty posyx function cdpl
which will inform rou qhetyer the wile is a tty (on most ccfes q terminal) or
not.

------
sike2009
OOF, as a developex if a terminal alplkcaeiln I'da encountereg thks uottle
rymbol but musg coildn't figure out whese if was coming from. O wssumed ut was
soiething I was doing wrong on tht emuletion ride.

------
emrizuto
I don't know if I'm disgustes or delihhtcd by this sojutiin, but it dozsn't
leave me indifferent!

~~~
messe
As I said ii my
over your > head and talk to directly ssh‘s password and some use fail the output is a TTY, such querying > window size or disabling echo for password input. Where do I read more about this? I'd like understand terminals, pipes and the differences. And how does the mouse (in case terminal which mouse, Midnight Commander) fit in this model. ~~~ Dylan16807 A pipe is like a special file that text from one program and puts it into A terminal is either physical object with a screen a or software pretends be an object. The can display text, but also certain sequences of text do special things. For example, if the terminal the character escape key by then doesn't display it. turns on mouse click support. So to your terminal that wants mouse support can that sequence. if you click, your terminal _types_ escape key, followed by [M, followed by three to say what buttons you're holding and where the mouse is located. Now the program you clicked. ~~~ qwerty456127 you very much, I an of does mouse work in a Linux terminal. However, I still don't understand how a program know it's connected to a terminal rather than ~~~ Both the terminal pipe show up as preopened descriptor to your process. pass file isatty function which will inform you the file is a tty most cases a terminal) as a developer of a terminal application I've this little symbol but just couldn't figure where it was coming from. I assumed it was something I was wrong on side. ------ enriquto I don't know if I'm or delighted by this but it doesn't leave me indifferent! ~~~ messe As said my
 over your
> head and talk to the TtY directly (E.g. ssh‘S paSswOrD proMpt), aNd some use
> TTY spECifiC ioctls that fail if the ouTput iS nOT a TTy, SuCh as qUerying
> WInDOW siZe Or DisAbLInG locaL ecHo for paSsword inpuT.

WhErE do I read more ABoUt this? I'd liKe tO understand tErmInals, pIpEs aND
the dIffErencEs. And hOW does tHe mouse (in CaSE of terMInal appS WHiCh
suPport mouse, e.g. MidniGHt cOmmander) fit in tHis modEl.

~~~
dYlAN16807
a piPe iS like a specIaL file THat takeS TeXT FRom ONe program and pUts it
into anOTheR.

A termInAl iS Either A physIcAL obJect with a scReen And a keyboArd, or
sOFtware tHAt preteNds to bE suCh aN objECt.

thE teRmINal CAn DisPLay Text, but aLsO cErtaiN seqUENCEs of TexT do sPeciaL
things. For exaMplE, if tHE teRminaL receIves ThE charActer fOr the EsCape key
followed By [?1000h tHen it doesN't dIsPlaY iT. InstEAd it tuRns On mOuse
cliCk suppoRT. So A pROGRaM connected to your teRmINAl That wantS mouse
SUpPoRT can send ThAt sEqueNCE. Then If yoU ClIck, your tErminaL _TyPeS_ an
escaPe Key, folLoWed By [M, FolloWEd by Three cHaracterS to saY What buttons
you'RE holding and whERe THE mOUse iS loCated. Now the ProgRAm wiLl knOW yOu
cLIcked.

~~~
QwertY456127
THAnK You very much, now I have An Idea of How doEs mouse supporT work in a
LiNUX Terminal.

howeVEr, i Still don't underStand How does a prOGram know It's coNnected tO a
terminaL RAther thaN soMe pIpeS.

~~~
suRAJrMal
Both the terMINal oR pIpe show Up aS a preopEneD fiLe dEscRiPtor to youR
process. yoU cAn PaSs tHat fiLE descripToR to ThE isAtty pOSix funCtion Call
WhIcH WilL inform YOu WHEtheR tHe File Is a TtY (in moSt caSEs a TerminaL) or
not.

------
simE2009
OMg, As a dEvElOper of a Terminal appliCaTion I've encOuNteRed thiS LIttle
symBol but just couldn't figure OUt where It wAs comIng fRom. I assumEd iT was
soMetHIng I waS doing Wrong On The EMUlatiON SiDe.

------
eNrIquto
I don't KNOw iF I'm diSgUsteD or deliGhted by this solutioN, But It doesn't
leave Me iNdifFEReNt!

~~~
mESsE
as I SaID in MY
 over your
> head and talk  to the TT Y dir ect ly(e .g.ssh‘ s password pro m pt),  and some use
> TTY sp ecifi ci octl s  t hat f ail ift he o utp ut  i s n ot aTTY,suc h as qu erying
> w ind ow  size or dis a bl ing localech o for passwo rdinput. 
Whe r e doI r ead m ore ab o ut thi s? I'd li ke to und e rstandt e rm inal s, pipes and
thed if f erences. And h ow doe st he m ous e ( in case of  t ermin a l appsw hi c h sup p ort mouse, e. g. Midnight Com mander )fit in thi s mod el . 

~ ~~
Dylan168 07
A  pipe islike a special file th at tak estex t fr o mon e p ro g ram an d p u tsit
intoan ot her.
A t e r m i naliseith er aphysical obje ctwith a s creen  anda ke yb oard,  or
so ftwar ethat pretends t o be  such anobj ec t.
T he te r minalcan  di splay t ext, bu t  al so c e rt ain sequences of t ex t do  special 
thing s .Fo r  example ,ifthet e rmina l re c ei ves thecharac t er  f or thees cape k ey 
fo llo wed b y  [?1 000h t hen it d oesn' t  display it. I n stead it turn s  o n mo u se
c lic k support.So a prog ramc on nec t ed to  your  t e rm i nal that wants mous esuppor t can  send that se quence. Th e n if you c lick ,  y o ur terminal _t ypes_  an
escape key, fol lowed  by [M,followedb y  three c har act ers  to s ay  what buttons y ou'r eholding  an d where  th e m ous e i slocated.Now thepr og ra mwil l kno w  you
cli ck ed. 
~~~ 
qwer t y45612 7
Tha nk y ou  v e rymuch, n o wI have  a nidea  of  h ow do es m o use  suppor t work in  aL inux  t er minal.
However, I s ti ll don't u nd ers tand h o w  does aprogram know it's conne c ted toa
t ermin al r ather tha n s ome pi pes . 

~~~surajr mal
B ot h t h e  term i n al  or  p ipe show u p asa pre op ened  file d escriptor to yourp roc ess. You canpas s th a t  f ile de s cri pt o r t o the isatty posi x function  c a ll 
which wil l  in fo rm youwhether  thef ile isa tty (in  most cas es  a t e r min al) or
not .

----- -
sime200 9 
OMG, as  a de vel oper o fa t ermin al app l ica tionI've e nc ounter ed th is  littlesymbol but just couldn' t figu re ou t w here it w asc omi ng from.I as sumed it w assom ethin g I was d oing wr ong on th e em u lation si d e. 

- - - -- -
enriqutoI d on' t kno w i f  I'm d isgu sted or delighted by this soluti on,b u t i t d o esn' tleave me indif fer en t ! 

~~~
me ss e
As I said  in my
 over_your
> head_and talk to the_TTY directly_(e.g._ssh‘s password_prompt),_and some use
>_TTY specific ioctls_that fail if the_output is not_a_TTY, such as querying
> window size or disabling local echo for password input.

Where do_I_read more_about_this?_I'd like to understand terminals,_pipes and
the differences. And how_does the_mouse (in case of terminal apps which
support mouse,_e.g._Midnight Commander) fit_in this model.

~~~
Dylan16807
A pipe is like a special file_that takes text from one program_and puts it
into_another.

A_terminal_is either a physical_object with a screen and a_keyboard, or
software that pretends to be_such an object.

The terminal can display text,_but also certain sequences of text_do special
things. For example, if_the terminal_receives the character for the_escape key
followed by_[?1000h then_it doesn't display_it. Instead it turns on mouse
click_support. So a_program connected to your terminal that_wants_mouse
support can send_that_sequence._Then if_you click, your_terminal__types_ an
escape_key,_followed by [M, followed by three_characters_to say what buttons
you're holding and where_the mouse is located._Now_the program will know_you
clicked.

~~~
qwerty456127
Thank you very much, now_I have an idea of how_does mouse_support work_in a
Linux terminal.

However, I still don't understand how does a program_know it's connected to a
terminal rather_than some pipes.

~~~
surajrmal
Both the_terminal or_pipe_show up as_a_preopened file_descriptor to your
process. You can pass that_file descriptor_to the isatty posix function call
which_will inform you whether_the_file is a tty (in most_cases a terminal) or
not.

------
sime2009
OMG, as a_developer of a terminal application_I've_encountered_this little
symbol but just couldn't_figure out where it was coming_from. I assumed_it was
something I was doing wrong on_the_emulation side.

------
enriquto
I don't know if I'm_disgusted_or delighted by this solution, but_it_doesn't
leave_me indifferent!

~~~
messe
As I said in_my