Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

Default Config::default_cwd to HOME_DIR

RoversXcebcb04a105a
diff --git a/config/src/config.rs b/config/src/config.rs
index 21f1f7b3..8d437873 100644
--- a/config/src/config.rs
+++ b/config/src/config.rs
@@ -225,6 +225,7 @@ pub struct Config {
/// Specifies the default current working directory if none is specified
/// through configuration or OSC 7 (see docs for `default_cwd` for more
/// info!)
+ #[dynamic(default = "default_cwd")]
pub default_cwd: Option<PathBuf>,
#[dynamic(default)]
@@ -921,6 +922,10 @@ fn default_ulimit_nproc() -> u64 {
2048
}
+fn default_cwd() -> Option<PathBuf> {
+ Some(HOME_DIR.clone())
+}
+
impl Default for Config {
fn default() -> Self {
// Ask FromDynamic to provide the defaults based on the attributes
@@ -2299,7 +2304,7 @@ fn default_colr_rasterizer() -> FontRasterizerSelection {
#[cfg(test)]
mod tests {
- use super::Config;
+ use super::{Config, HOME_DIR};
struct EnvGuard {
config_file: Option<std::ffi::OsString>,
@@ -2328,6 +2333,11 @@ mod tests {
}
}
+ #[test]
+ fn default_cwd_is_home() {
+ assert_eq!(Config::default().default_cwd.as_ref(), Some(&*HOME_DIR));
+ }
+
#[test]
fn import_loader_restores_env_and_collects_raw_keys() {
let _guard = EnvGuard::new();