Re: Question about write a simple shell : how to output resoult to tty correctly



thank you for your reply;

Are you trying to write a shell in C++?
something like that

why you should resort to ncurses or anything other than std::cin and
std::cout to do your command I/O.

If you are trying to implement some
kind of command line editing, then you might want to set the tty into
"raw" mode to allow you to override the built-in editing. If you are
not trying to implement command line editing, then why not just stick
with stdio?


May be the story beginning from my self educated roadmap of how
rogramming -- 2 year ,a reversed way:

"OO design ; C++ ; STD; design patterns ; ACE ; UNIX/LINUX BASIC(fd thread
process mutex...);UNIX SOCKET ; UNIX IO, gnu clib...)
(no C experience,start from little/almost no programming experience)

So my application is design/running on my mind for 2 years.

before coding ,I don't think I/O is a problem until I met I must scan "a
keypress" to make my parser to determine action. std::cin have no this
function(getch()),
also I want my app(actually it can be called a Library) can running on
other OS . either GUI and CLI , so there must be a adapter layer.(use
"string" to link them)

I found I have to design an other lib to adapter UNIX I/O,

and may be due to greed, I want lib have "ERR , DEBUG , COUT_..."belong to
itself , they can display on same screen or sparated, or dump to file ,so
it's may be need a window manager.
........
.......
.......

finally I lost my mind , my pool knowledge about ui design drive me crazy.
reinvent the big wheel?

so I found "ncurses" and pin my hope on it , and after serval day's trying ,
almost there , but still have problem --- telnet can not display it
correctly.... crazy again. ^_^

.......


As you see I am a "dabbler" now ,especially no experience on C :-) . may
be afraid , may be just too lazy to study "tty" it self.


now I am reading "Joe's Own Editor" , I hope after another serval days , I
can master it.


ps: I didn't found there's a c++ lib can do such things -----(pure code) a
chartype window manager ,support sub window ,with string to as display ,can
adapter with basic IO . etc...
to wrote it is too expensive for me , if you know one , please tell me.












.



Relevant Pages

  • RE: Insert a Record?
    ... Use the old INSERT command. ... VFP 3.0 Help file: ... The new record is then displayed for editing. ... In Visual FoxPro, INSERT cannot be used on a table in a database that has ...
    (microsoft.public.fox.helpwanted)
  • Re: Voice processing Dialogic D/41EPCI card
    ... This is the entire output of hw -v -r pci command with the card that does ... 0x0107 Memory Enabled, I/O Enabled ... ROMbaseAddress: 0x00000000 Expan ROM 0x00000000, ...
    (comp.unix.sco.misc)
  • Re: [MSH] MSH Not So Great For Interactive Users
    ... The keystrokes involved date back to the earliest versions of DOS in some cases, but primarily aim for compatibility with DOSKEY, which dates from DOS 5.0 iirc. ... I wasn't talking about arrow key editing but rather command line editing and substitution done via syntactic operators. ... http://www.coldie.net/project/jamsh is a MSH host that uses the GNU readline library and is probably a lot closer to what you are looking for - MSH with vi or emacs keystrokes. ... One big step in the right direction was the commitment that everything that can be done from a GUI can now be done from the command line. ...
    (microsoft.public.windows.server.scripting)
  • Re: RPN vs Algebraic UTPN failure in program
    ... It's actually normal, a direct consequence of the editing rules, ... The same would occur if you pressed any other command key ... whenever you are editing in RPN mode, ... you have to turn on the editor's PRG (program editing) state, ...
    (comp.sys.hp48)
  • Re: [MSH] Bug: cut & paste with tabs
    ... implemented in Windows by a subsystem instead of in a user mode library like ... automatically gets essentially the same command line editing behaviour. ... > So this means that MSH actually invokes the cmd.exe shell? ...
    (microsoft.public.windows.server.scripting)