diff --git a/.gitignore b/.gitignore index 5313c4b014..e9efbd1b3b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ include/mamba/core/version.hpp **/build/ **/build-*/ CMakeUserPresets.json +**/cmake-build-debug/ # CMake files that should not exists because they should be generated under a build folder CMakeLists.txt.user diff --git a/libmamba/src/core/transaction.cpp b/libmamba/src/core/transaction.cpp index e51ef33863..dc27d452e3 100644 --- a/libmamba/src/core/transaction.cpp +++ b/libmamba/src/core/transaction.cpp @@ -1088,15 +1088,26 @@ namespace mamba } else { - // TODO: add executable name - // TODO: add environment name/prefix LOG_INFO << "Waiting for pyc compilation to finish"; m_transaction_context.wait_for_pyc_compilation(); + + // Get the name of the executable used directly from the command. + const auto executable = ctx.command_params.is_micromamba ? "micromamba" : "mamba"; + + // Get the name of the environment + const auto environment = env_name(ctx.prefix_params.target_prefix); + Console::stream() << "\nTransaction finished\n\n" << "To activate this environment, use:\n\n" - << " $ [micro]mamba activate \n\n" + << " " << executable << " activate " << environment << "\n\n" << "Or to execute a single command in this environment, use:\n\n" - << " $ [micro]mamba run -n mycommand\n"; + << " " << executable + << " run " + // Use -n or -p depending on if the env_name is a full prefix or just + // a name. + << (environment == ctx.prefix_params.target_prefix ? "-p " : "-n ") + << environment << " mycommand\n"; + prefix.history().add_entry(m_history_entry); }