duplicate param

This commit is contained in:
Levi Neely 2026-08-02 22:10:31 +02:00
parent 753467db5b
commit bd78b2b703
1 changed files with 9 additions and 5 deletions

View File

@ -338,7 +338,7 @@ bool Ollie9pClient::createSession(const QString &cwd, const QString &name, const
if (!model.isEmpty()) agentArgs << "model=" + model;
if (!agent.isEmpty()) agentArgs << "agent=" + agent;
if (!remote.isEmpty()) agentArgs << "remote=" + remote;
if (!agentAlias.isEmpty()) agentArgs << "agent_alias=" + agentAlias;
if (!agentAlias.isEmpty()) agentArgs << "name=" + agentAlias;
QProcess proc;
QStringList args = {"-a", serverAddr(), "rdwr", "session/" + sessName + "/agent/new"};
@ -409,12 +409,16 @@ bool Ollie9pClient::renameAgent(const QString &sessionId, const QString &agentId
return false;
}
// Write name=<newName> to the agent's ctl file — Plan 9 style.
QProcess proc;
proc.setProgram(bin);
proc.setArguments({"-a", serverAddr(), "mv",
"session/" + sessionId + "/agent/" + agentId,
"session/" + sessionId + "/agent/" + newName});
proc.setArguments({"-a", serverAddr(), "rdwr",
"session/" + sessionId + "/agent/" + agentId + "/ctl"});
proc.start();
proc.waitForStarted(3000);
QByteArray input = QString("name=" + newName + "\n").toUtf8();
proc.write(input);
proc.closeWriteChannel();
proc.waitForFinished(5000);
if (proc.exitCode() != 0) {
@ -422,7 +426,7 @@ bool Ollie9pClient::renameAgent(const QString &sessionId, const QString &agentId
return false;
}
if (m_activeSessionId == sessionId && m_agentId == agentId) {
if (m_activeSessionId == sessionId) {
m_agentId = newName;
emit activeAgentIdChanged();
}