mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 18:24:45 -05:00
ecdaf991c6
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.
22 lines
422 B
C
22 lines
422 B
C
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
#include <AK/Vector.h>
|
|
#include <termios.h>
|
|
|
|
struct GlobalState {
|
|
String cwd;
|
|
String username;
|
|
String home;
|
|
char ttyname[32];
|
|
char hostname[32];
|
|
pid_t sid;
|
|
uid_t uid;
|
|
struct termios termios;
|
|
bool was_interrupted { false };
|
|
bool was_resized { false };
|
|
int last_return_code { 0 };
|
|
Vector<String> directory_stack;
|
|
};
|
|
|
|
extern GlobalState g;
|