diff --git a/src/main.c b/src/main.c
index 5bc008c..2b5a431 100644
--- a/src/main.c
+++ b/src/main.c
@@ -95,6 +95,9 @@ static void sigcont_handler(int sig)
}
#else
foreground_in = foreground_out = 1;
+ #if defined(AMIGA) || defined(__AMIGA__) || defined(__AROS__)
+ set_tty(); /* amiga version -- sets stdin to raw mode. */
+ #endif
#endif
if (sig != 0)
diff --git a/src/terminal.c b/src/terminal.c
index a6302b7..05f23a6 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -10,7 +10,17 @@
#include
#include "common.h"
-#ifdef HAVE_TERMIOS_H
+#if defined(AMIGA) || defined(__AMIGA__) || defined(__AROS__)
+#ifdef __amigaos4__
+#define __USE_INLINE__
+#endif
+#include
+#include
+
+#define MODE_NORMAL 0
+#define MODE_RAW 1
+
+#elif defined HAVE_TERMIOS_H
#include
#include
@@ -19,7 +29,10 @@ static struct termios term;
int set_tty(void)
{
-#ifdef HAVE_TERMIOS_H
+#if defined(AMIGA) || defined(__AMIGA__) || defined(__AROS__)
+ SetMode(Input(), MODE_RAW);
+
+#elif defined HAVE_TERMIOS_H
struct termios t;
if (!isatty(STDIN_FILENO))
@@ -40,7 +53,10 @@ int set_tty(void)
int reset_tty(void)
{
-#ifdef HAVE_TERMIOS_H
+#if defined(AMIGA) || defined(__AMIGA__) || defined(__AROS__)
+ SetMode(Input(), MODE_NORMAL);
+
+#elif defined HAVE_TERMIOS_H
if (!isatty(STDIN_FILENO))
return 0;
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &term) < 0) {