fix amiga terminal behavior (set stdin to raw mode)

master
sezero 9 years ago committed by Claudio Matsuoka
parent 8c9ace4606
commit 3056bfd713
  1. 3
      src/main.c
  2. 22
      src/terminal.c

@ -95,6 +95,9 @@ static void sigcont_handler(int sig)
} }
#else #else
foreground_in = foreground_out = 1; foreground_in = foreground_out = 1;
#if defined(AMIGA) || defined(__AMIGA__) || defined(__AROS__)
set_tty(); /* amiga version -- sets stdin to raw mode. */
#endif
#endif #endif
if (sig != 0) if (sig != 0)

@ -10,7 +10,17 @@
#include <xmp.h> #include <xmp.h>
#include "common.h" #include "common.h"
#ifdef HAVE_TERMIOS_H #if defined(AMIGA) || defined(__AMIGA__) || defined(__AROS__)
#ifdef __amigaos4__
#define __USE_INLINE__
#endif
#include <proto/exec.h>
#include <proto/dos.h>
#define MODE_NORMAL 0
#define MODE_RAW 1
#elif defined HAVE_TERMIOS_H
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>
@ -19,7 +29,10 @@ static struct termios term;
int set_tty(void) 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; struct termios t;
if (!isatty(STDIN_FILENO)) if (!isatty(STDIN_FILENO))
@ -40,7 +53,10 @@ int set_tty(void)
int reset_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)) if (!isatty(STDIN_FILENO))
return 0; return 0;
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &term) < 0) { if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &term) < 0) {

Loading…
Cancel
Save