package nxm.sys.intr;

import nxm.sys.lib.Intrinsic;

/**
  Exits the current shell, saving the current session.

  @author Jeff Schoen
*/
public class Exit extends Intrinsic {

  /** default constructor */
  public Exit () {}

  @SuppressWarnings("deprecation")  // for M.terminal - since 3.7.1 for NXM-2813
  public int process() {
    if (M.terminal.archiver != null) M.terminal.archiver.close();
    // M.status = EXIT;  this is now handled by the shell class
    return FINISH;
  }
}
