From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6a5262b0e069cfdf X-Google-Attributes: gid103376,public From: jerry@jvdsys.stuyts.nl (Jerry van Dijk) Subject: Re: Terminal Control (or System calls), unix Date: 1999/04/03 Message-ID: #1/1 X-Deja-AN: 462146432 References: <3703F011.1DBB143C@cs.und.edu> <7e2rp3$kvf$1@nnrp1.dejanews.com> Organization: * JerryWare *, Leiden, Holland Newsgroups: comp.lang.ada Date: 1999-04-03T00:00:00+00:00 List-Id: dennison@telepath.com wrote: : In article <3703F011.1DBB143C@cs.und.edu>, : "Sven E. Anderson" wrote: (note I careful I am about the attributions :-) : > I am attempting to write a simple screen editor with Ada95 and would : > like to suppress the tty echo (unix/linux). A very simple solution : > would be a system call to "stty -echo cbreak". How might I make such : > a call in Ada? : If its a system call, you should be able to make it from Ada. However I think : stty is typically a shell builtin, isn't it? That does not matter, on Linux, you could use something like: with System; procedure No_Echo is type Echo_Type is (On, Off); procedure Set_Echo (Echo : in Echo_Type) is procedure Execute (S : in String) is procedure System (S : in System.Address); pragma Import (C, System, "system"); C_String : constant String := S & ASCII.NUL; begin System (C_String'Address); end Execute; pragma Inline (Execute); begin if Echo = On then Execute ("stty -echo cbreak"); else Execute ("stty echo"); end if; end Set_Echo; begin null; end No_Echo; -- -- Jerry van Dijk | Leiden, Holland -- Team Ada | jdijk@acm.org -- see http://stad.dsl.nl/~jvandyk