#import "Tty.h"

struct stateStack {
  struct sgttyb state;
  struct stateStack * next;
};

@interface Term:Tty
{
  BOOL crlast;
  struct stateStack *stack;
}

+ new;
- pushState;
- popState;
- (int)getchar;
- (int)getcharWithPrompt:(char *)prompt;
- (int)getline:(char *)string size:(int)max;
- (int)getline:(char *)string size:(int)max WithPrompt:(char *)prompt;
- putString:(char *)string;  // set's terminal sane before writeOut
- putPrompt:(char *)string;  // uses stdout, but resets 'self' in case it's == stdout
- ringBell;

@end
