From b4fd3816c85c9ac5172d25434868d0c3df482593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 1 Nov 2004 03:51:21 +0000 Subject: [PATCH] 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 --- src/kernel/apps/consoled/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kernel/apps/consoled/main.c b/src/kernel/apps/consoled/main.c index 60a478befb..49a566605a 100644 --- a/src/kernel/apps/consoled/main.c +++ b/src/kernel/apps/consoled/main.c @@ -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 #include #include +#include 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);