summaryrefslogtreecommitdiff
path: root/Shell/GlobalState.h
diff options
context:
space:
mode:
authorJesse Buhagiar <jesse.buhagiar@student.rmit.edu.au>2019-09-15 18:54:20 +1000
committerAndreas Kling <awesomekling@gmail.com>2019-09-15 14:16:40 +0200
commitecdaf991c623ec929ec054531e6519f50ca9c060 (patch)
treee8cf0cbf0c113577e5482ef82f2b10eca97bf74e /Shell/GlobalState.h
parent85d629103daa3fcf48445b7e924a74d17986877d (diff)
downloadserenity-ecdaf991c623ec929ec054531e6519f50ca9c060.zip
Shell: Added `pushd`, `popd` and `dirs` builtins
Added a few builtin functions to the shell to make navigating a bit easier in the terminal. `pushd` allows a user to "push" the current directory to the directory stack, and then `cd` to the new directory. `popd` allows the used to take the directory on the top of the stack off before `cd`'ing to it. `dirs` gives the state of the current directory stack. This is only a partial implementation of the `bash` version (gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html) , and doesn't include any of the +N or -N commands as of yet.
Diffstat (limited to 'Shell/GlobalState.h')
-rw-r--r--Shell/GlobalState.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Shell/GlobalState.h b/Shell/GlobalState.h
index d87d798356..e92dd8df3e 100644
--- a/Shell/GlobalState.h
+++ b/Shell/GlobalState.h
@@ -1,6 +1,7 @@
#pragma once
#include <AK/String.h>
+#include <AK/Vector.h>
#include <termios.h>
struct GlobalState {
@@ -15,6 +16,7 @@ struct GlobalState {
bool was_interrupted { false };
bool was_resized { false };
int last_return_code { 0 };
+ Vector<String> directory_stack;
};
extern GlobalState g;