Support setting environment to the terminal process.

WIP fixes in DAP runInTerminal and working on startDebugging.
This commit is contained in:
Martín Lucas Golini
2025-06-21 02:14:43 -03:00
parent 2fb80cd94a
commit 03df17b96b
18 changed files with 131 additions and 79 deletions

View File

@@ -2201,17 +2201,16 @@ void DebuggerPlugin::run( const std::string& debugger, ProtocolSettings&& protoc
DebuggerClientDap* dap = static_cast<DebuggerClientDap*>( mDebugger.get() );
dap->runInTerminalCb = [this]( bool isIntegrated, std::string cmd,
const std::vector<std::string>& args, const std::string& cwd,
const std::unordered_map<std::string, std::string>& /*env*/,
const std::unordered_map<std::string, std::string>& env,
std::function<void( int )> doneFn ) {
if ( !FileSystem::fileExists( cmd ) )
cmd = FileSystem::fileNameFromPath( cmd );
getUISceneNode()->runOnMainThread( [this, isIntegrated, cmd = std::move( cmd ), cwd, args,
doneFn = std::move( doneFn )] {
if ( isIntegrated ) {
doneFn = std::move( doneFn ), env = std::move( env )] {
if ( isIntegrated || !env.empty() ) {
UITerminal* term =
getPluginContext()->getTerminalManager()->createTerminalInSplitter(
cwd, cmd, args, false );
term->getTerm()->setKeepAlive( false );
cwd, cmd, args, env, false, false );
doneFn( term && term->getTerm() && term->getTerm()->getTerminal() &&
term->getTerm()->getTerminal()->getProcess()