parity, and 8-bit characters with no parity. The following special
characters are recognized: @ and Control-U (kill); #, DEL and
back space (erase); carriage return and line feed (end of line).
+See also \fB\-\-erase-chars\fP and \fB\-\-kill-chars\fP options.
.IP o
Optionally deduces the baud rate from the CONNECT messages produced by
Hayes(tm)-compatible modems.
this option enabled, the full qualified hostname by gethostname()
or if not found by getaddrinfo() is shown.
.TP
+\-\-erase\-chars \fIstring\fP
+This option specifies additional chars that should be interpreted as a
+backspace (ignore previous char) when user specifies login name. The default is
+\'#\', specify empty string to disable the default.
+.TP
+\-\-kill\-chars \fIstring\fP
+This option specifies additional chars that should be interpreted as a
+kill (ignore all previous chars) when user specifies login name.
+The default is \'@\', specify empty string to disable the default.
+.TP
\-\-version
Output version information and exit.
.TP
char *term; /* terminal type */
char *initstring; /* modem init string */
char *issue; /* alternative issue file */
+ char *erasechars; /* string with erase chars */
+ char *killchars; /* string with kill chars */
int delay; /* Sleep seconds before prompt */
int nice; /* Run login with this priority */
int numspeed; /* number of baud rates to try */
.flags = F_ISSUE, /* show /etc/issue (SYSV_STYLE) */
.login = _PATH_LOGIN, /* default login program */
.tty = "tty1", /* default tty line */
- .issue = ISSUE /* default issue file */
+ .issue = ISSUE, /* default issue file */
+ .erasechars = "#", /* default additional erase char */
+ .killchars = "@" /* default additional kill char */
};
char *login_argv[LOGIN_ARGV_MAX + 1];
int login_argc = 0;
NOHINTS_OPTION,
NOHOSTNAME_OPTION,
LONGHOSTNAME_OPTION,
- HELP_OPTION
+ HELP_OPTION,
+ ERASE_CHARS_OPTION,
+ KILL_CHARS_OPTION,
};
const struct option longopts[] = {
{ "8bits", no_argument, 0, '8' },
{ "long-hostname", no_argument, 0, LONGHOSTNAME_OPTION },
{ "version", no_argument, 0, VERSION_OPTION },
{ "help", no_argument, 0, HELP_OPTION },
+ { "erase-chars", required_argument, 0, ERASE_CHARS_OPTION },
+ { "kill-chars", required_argument, 0, KILL_CHARS_OPTION },
{ NULL, 0, 0, 0 }
};
case LONGHOSTNAME_OPTION:
op->flags |= F_LONGHNAME;
break;
+ case ERASE_CHARS_OPTION:
+ op->erasechars = optarg;
+ break;
+ case KILL_CHARS_OPTION:
+ op->killchars = optarg;
+ break;
case VERSION_OPTION:
printf(_("%s from %s\n"), program_invocation_short_name,
PACKAGE_STRING);
/* Read name, watch for break and end-of-line. */
while (cp->eol == '\0') {
+ char key;
+
if (read(STDIN_FILENO, &c, 1) < 1) {
/* Do not report trivial like EINTR/EIO errors. */
cp->parity |= ((bits & 1) ? 1 : 2);
}
+ if (op->killchars && strchr(op->killchars, ascval))
+ key = CTL('U');
+ else if (op->erasechars && strchr(op->erasechars, ascval))
+ key = DEL;
+ else
+ key = ascval;
+
/* Do erase, kill and end-of-line processing. */
- switch (ascval) {
+ switch (key) {
case 0:
*bp = 0;
if (op->numspeed > 1)
break;
case BS:
case DEL:
- case '#':
cp->erase = ascval; /* set erase character */
if (bp > logname) {
if ((tp->c_lflag & ECHO) == 0)
}
break;
case CTL('U'):
- case '@':
cp->kill = ascval; /* set kill character */
while (bp > logname) {
if ((tp->c_lflag & ECHO) == 0)
" --nonewline do not print a newline before issue\n"
" --no-hostname no hostname at all will be shown\n"
" --long-hostname show full qualified hostname\n"
+ " --erase-chars <string> additional backspace chars\n"
+ " --kill-chars <string> additional kill chars\n"
" --version output version information and exit\n"
" --help display this help and exit\n\n"));