From 66fdfb1e319d779a2f8aa54057e3910dd629d316 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 23 Aug 2025 18:44:18 +1200 Subject: [PATCH] Update source/src/commands/ssh.cpp --- source/src/commands/ssh.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/src/commands/ssh.cpp b/source/src/commands/ssh.cpp index b411f25..70a2357 100644 --- a/source/src/commands/ssh.cpp +++ b/source/src/commands/ssh.cpp @@ -2,6 +2,7 @@ #include "config.hpp" #include "utils/utils.hpp" #include "utils/directories.hpp" +#include "utils/execute.hpp" #include "shared_commands.hpp" #include "servers.hpp" #include "services.hpp" @@ -48,7 +49,12 @@ namespace dropshell error << "Server " << server << " is not valid" << std::endl; return false; } - execute_ssh_command(server_env.get_SSH_INFO(user), sCommand(remotepath(server, user).DROPSHELL_DIR(), "ls --color && bash", {}), cMode::Interactive); + std::string dropshell_dir = remotepath(server, user).DROPSHELL_DIR(); + std::string bash_cmd = "ls --color && exec bash --rcfile <(cat ~/.bashrc 2>/dev/null; echo 'cd " + quote(dropshell_dir) + "')"; + + info << "SSHing into " << server << ":" << dropshell_dir << " as user " << user << std::endl; + + execute_ssh_command(server_env.get_SSH_INFO(user), sCommand(dropshell_dir, bash_cmd, {}), cMode::Interactive); return true; }