Fixed the stupid bug that prevented you to see what you typed in when bash

was running. Thanks a lot to Jerome Duval who found this!
Since TTY ECHO mode doesn't look too well with the old shell, it will directly
start "sh" now, which should be the bash.
No longer prints out the TTY used when started, but now sets (as usually
done in BeOS) the TTY environment variable.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9697 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-11-01 03:51:21 +00:00
parent 0e0c2b2927
commit b4fd3816c8

View File

@ -1,4 +1,7 @@
/*
** Copyright 2004, The Haiku Team. All rights reserved.
** Distributed under the terms of the Haiku License.
**
** Copyright 2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
@ -13,6 +16,7 @@
#include <dirent.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct console {
@ -98,7 +102,6 @@ start_console(struct console *con)
continue;
sprintf(name, "/dev/pt/%s", entry->d_name);
puts(name);
con->tty_master_fd = open(name, O_RDWR);
if (con->tty_master_fd >= 0) {
@ -117,12 +120,14 @@ start_console(struct console *con)
termios.c_oflag = OPOST | ONLCR;
termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHONL;
tcsetattr(con->tty_slave_fd, TCSETA, &termios);
tcsetattr(con->tty_slave_fd, TCSANOW, &termios);
}
}
break;
}
}
setenv("TTY", name, true);
}
if (con->tty_master_fd < 0 || con->tty_slave_fd < 0)
@ -196,7 +201,7 @@ main(void)
status_t retcode;
const char *argv[3];
argv[0] = "/bin/shell";
argv[0] = "/bin/sh";
// argv[1] = "-s";
// argv[2] = "/boot/loginscript";
shell_process = start_process(1, argv, &theconsole);