Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Enzo Cioppettini
ion
Commits
ea4b98c9
Commit
ea4b98c9
authored
7 years ago
by
Michael Aaron Murphy
Browse files
Options
Downloads
Patches
Plain Diff
Document Shell Structure
parent
03335376
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/shell/mod.rs
+17
-3
17 additions, 3 deletions
src/shell/mod.rs
with
17 additions
and
3 deletions
src/shell/mod.rs
+
17
−
3
View file @
ea4b98c9
...
...
@@ -93,21 +93,35 @@ fn word_divide(buf: &Buffer) -> Vec<(usize, usize)> {
res
}
/// Th
is struct will contain all of the data structures related to
th
is
///
instance of the shell
.
/// Th
e shell structure is a megastructure that manages all of the state of the shell throughout the entirety of
th
e
///
program. It is initialized at the beginning of the program, and lives until the end of the program
.
pub
struct
Shell
<
'a
>
{
/// Contains a list of built-in commands that were created when the program started.
pub
builtins
:
&
'a
FnvHashMap
<&
'static
str
,
Builtin
>
,
pub
context
:
Context
,
/// Contains the history, completions, and manages writes to the history file.
pub
context
:
Option
<
Context
>
,
/// Contains the aliases, strings, and array variable maps.
pub
variables
:
Variables
,
/// Contains the current state of flow control parameters.
flow_control
:
FlowControl
,
/// Contains the directory stack parameters.
pub
directory_stack
:
DirectoryStack
,
/// Contains all of the user-defined functions that have been created.
pub
functions
:
FnvHashMap
<
Identifier
,
Function
>
,
/// When a command is executed, the final result of that command is stored here.
pub
previous_status
:
i32
,
/// Contains all the boolean flags that control shell behavior.
pub
flags
:
u8
,
/// When a signal is received in the main thread's event loop, the signal will be sent to this receiver. The shell
/// will check this receiver at certain key points throughout the shell's lifetime.
pub
signals
:
Receiver
<
i32
>
,
/// A temporary field for storing foreground PIDs used by the pipeline execution.
foreground
:
Vec
<
u32
>
,
/// Contains information on all of the active background processes that are being managed by the shell.
pub
background
:
Arc
<
Mutex
<
Vec
<
BackgroundProcess
>>>
,
/// Set when a signal is received, this will tell the flow control logic to abort.
pub
break_flow
:
bool
,
/// When the `fg` command is run, this will be used to communicate with the specified background process.
pub
foreground_signals
:
Arc
<
ForegroundSignals
>
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment