Update copyright to 2017
[nikiroo-utils.git] / src / jexer / TTerminalWindow.java
index c0af74bafa12ce9046277f0eab0746c7571bee43..41c4b5eca784aaa051f7b5566cb6262fd1a8532d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The MIT License (MIT)
  *
- * Copyright (C) 2016 Kevin Lamonte
+ * Copyright (C) 2017 Kevin Lamonte
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -166,7 +166,7 @@ public class TTerminalWindow extends TWindow {
                 "script", "-fqe", "/dev/null"
             };
             String [] cmdShellBSD = {
-                "script", "-qe", "-F", "/dev/null"
+                "script", "-q", "-F", "/dev/null"
             };
             // Spawn a shell and pass its I/O to the other constructor.
 
@@ -200,6 +200,9 @@ public class TTerminalWindow extends TWindow {
 
         // Claim the keystrokes the emulator will need.
         addShortcutKeys();
+
+        // Add shortcut text
+        newStatusBar("Terminal session executing...");
     }
 
     /**
@@ -263,6 +266,9 @@ public class TTerminalWindow extends TWindow {
 
         // Claim the keystrokes the emulator will need.
         addShortcutKeys();
+
+        // Add shortcut text
+        newStatusBar("Terminal session executing...");
     }
 
     /**
@@ -358,7 +364,8 @@ public class TTerminalWindow extends TWindow {
     /**
      * Handle window close.
      */
-    @Override public void onClose() {
+    @Override
+    public void onClose() {
         emulator.close();
         if (shell != null) {
             terminateShellChildProcess();
@@ -406,6 +413,8 @@ public class TTerminalWindow extends TWindow {
                     shell = null;
                     emulator.close();
                     clearShortcutKeypresses();
+                    statusBar.setText("Terminal session completed, exit " +
+                        "code " + rc + ".");
                 } catch (IllegalThreadStateException e) {
                     // The emulator thread has exited, but the shell Process
                     // hasn't figured that out yet.  Do nothing, we will see
@@ -421,6 +430,8 @@ public class TTerminalWindow extends TWindow {
                     shell = null;
                     emulator.close();
                     clearShortcutKeypresses();
+                    statusBar.setText("Terminal session completed, exit " +
+                        "code " + rc + ".");
                 } catch (IllegalThreadStateException e) {
                     // The shell is still running, do nothing.
                 }