From 907e0c18321c28eeced06fa2454211c2a544c1ae Mon Sep 17 00:00:00 2001 From: Max Wash Date: Mon, 15 Jun 2026 17:41:41 +0100 Subject: [PATCH] frontend: evaluate /profile.bshell on startup --- bshell/main.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bshell/main.c b/bshell/main.c index 29ced2c..4e968da 100644 --- a/bshell/main.c +++ b/bshell/main.c @@ -9,6 +9,7 @@ #include #include #include +#include #include enum { @@ -83,6 +84,30 @@ static int bshell( frontend_init(&ctx, flags); enum bshell_status status = BSHELL_SUCCESS; + fx_path *config_base_dir = fx_path_get_system(FX_PATH_CONFIG); + fx_path *profile_path = fx_path_join_list( + 3, + &FX_VALUE_OBJECT(config_base_dir), + &FX_CSTR("bshell"), + &FX_CSTR("profile.bshell")); + fx_path_unref(config_base_dir); + + if (fx_path_is_file(profile_path)) { + status = frontend_eval_file( + &ctx, + NULL, + fx_path_get_cstr(profile_path)); + + if (status != BSHELL_SUCCESS) { + fprintf(stderr, + "%s: cannot evaluate '%s': %s\n", + exec_name, + fx_path_get_cstr(profile_path), + bshell_status_get_description(status)); + } + } + fx_path_unref(profile_path); + size_t nr_input_files = fx_arglist_get_count( opt, FX_COMMAND_INVALID_ID,