aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorJonas Maier <>2026-03-10 17:03:16 +0100
committerJonas Maier <>2026-03-10 17:03:16 +0100
commitfb443270b14ad4d404f6b401f83b323a9769e667 (patch)
tree142eb56303c5e6b17ccb9f93af992bc082a11778 /src/main.rs
parent27ee3f07c39f3f584fac4a8712dd4fe97e46e462 (diff)
downloadpish-fb443270b14ad4d404f6b401f83b323a9769e667.tar.gz
command-name completion based on PATH
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 5e7d40a..7a8d864 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,6 +30,7 @@ pub mod serialization;
use linebuf::LineBuf;
use raw::*;
+use crate::completion::PathCache;
use crate::cursor::{Direction, move_cursor};
use crate::history::HistoryEntry;
use crate::parse::{Ast, PreExpansion};
@@ -74,6 +75,7 @@ pub struct Session {
vars: HashMap<BString, BString>,
funs: HashMap<BString, Ast<PreExpansion>>,
socket_running: Option<export_fun::SocketRunning>,
+ path_cache: PathCache,
/// n before end of history.len()
/// 0 == not checking history
@@ -270,11 +272,14 @@ fn event_loop() {
socket_running: None,
vars: HashMap::new(),
funs: HashMap::new(),
+ path_cache: Default::default(),
};
print!("{}", se.prompt());
let session = Arc::new(Mutex::new(se));
+ completion::populate_path_cache(session.clone());
+
let _sock_dropper = export_fun::listen(session.clone());
loop {