wduquette / molt

Embeddable TCL Interpreter for Rust applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

molt_shell::repl configuration

wduquette opened this issue · comments

The molt_shell::repl should support loading user configuration from something like a .moltrc file. Since the intent of Molt is that different applications have their own shells, the name and location of this file should be determined by the builder of the shell; but the standard Molt shell should use ${XDG_CONFIG_HOME}/molt/config.tcl, defaulting to ~/.config/molt/config.tcl, consistent with the XDG Base Directory Specification.

molt_shell::repl should load this file at startup. Errors should be handled as by TCL 8.6: the error message is output prior to the first prompt.

Notes:

  • Rust does not provide "~" expansion by default.
  • The shellexpand crate provides both "~" and environment variable expansion in directory paths, using the dirs crate for the heavy lifting, and could make this much easier.
    • But, eventually we may want to support "~" expansion in the main Molt crate for Molt's "file" commands (or in some ancillary crate for that purpose); I'm reluctant to accept these as a dependency until that's resolved.