From fb443270b14ad4d404f6b401f83b323a9769e667 Mon Sep 17 00:00:00 2001 From: Jonas Maier <> Date: Tue, 10 Mar 2026 17:03:16 +0100 Subject: command-name completion based on PATH --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.rs') 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, funs: HashMap>, socket_running: Option, + 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 { -- cgit v1.2.3