CaT wrote:
> > > If so then it's just as I suspected. mingetty DOESN'T put it in raw mode.
> > > The source code says the same thing.
> >
> > In that case, you could try replacing mingetty with a script, which
> > performs a `stty erase ^H' before invoking mingetty. However, mingetty
> > might override this (one of the functions of a getty is to put the
> > terminal driver into a `known good' state).
>
> Having looked at the source for rungetty (only one I've got :) it closes
> stdin, out and err and then reopens them. From what I can gather this means
> any prior changes made to the tty are fragged?
Yes. The changes would have to be made to rungetty itself.
> > > > > For other getty programs, you may need to specify a command-line
> > > > > switch or a configuration file option, or even recompile them.
> > >
> > > No command line or compile time opt exist. Still finding a recent
> > > version of mingetty in tarball format is a bitch. :/ Rungetty is
> > > similar tho.
> >
> > Hmm. getty_ps uses /etc/gettydefs, which allows you to set the
> > terminal driver parameters (although those which relate to
> > canonical-mode processing won't work, as it uses raw mode).
>
> changing /etc/gettydefs didn't work. This may be because mingetty (what
> I'm running) doesn't use it or because I fubared the entry. I tried
> doing what I wanted by adding 'ERASE ' (ERASE ^H) to both the initial
> and final states.
OK. It was just a guess.
> > If there aren't any command-line option, the simplest solution is
> > probably to modify the source code. I'm guessing that it will be
> > setting the erase character explicitly; search for `tcsetattr' and/or
> > `VERASE'.
>
> Neither of these two exist in the rungetty source code. The reason I'm
> using rungetty while running mingetty is that the rungetty code is an
> offshoot of mingetty and is more recent then the most recent mingetty
> I could find. Anyways, I thought about adding a bit of code to set
> the VERASE parameter to ^H but couldn't for the life of me figure out
> how to use tcsetattr to do this. The manpage was not all that helpful
> and did not talk one bit how to set things like erase etc. The termbits.h
> include wasn't all that helpful either cos well... as include files
> tend to do, it just gave definitions for constants, structs, vars and
> so on. :)
>
> The lack of commenting anywhere wasn't helping either. :/
It doesn't use stty() does it? (stty() was the BSD alternative to
tcsetattr()).
If it doesn't use either (i.e. it just open()s the device and then
tries to talk to it), then you should be able to change the settings
at any point after the open().
The following code is roughly what's required:
#include <termios.h>
#include <unistd.h>
...
struct termios t;
...
tcgetattr(fd, &t);
t.cc_t[VERASE] = '\b';
tcsetattr(fd, TCSANOW, &t);
--
Glynn Clements <[EMAIL PROTECTED]>
-====---====---====---====---====---====---====---====---====---====---====-
to unsubscribe email "unsubscribe linux-admin" to [EMAIL PROTECTED]
See the linux-admin FAQ: http://www.kalug.lug.net/linux-admin-FAQ/