diff --git a/src/server/core/agent.nim b/src/server/core/agent.nim index b7d8588..6990046 100644 --- a/src/server/core/agent.nim +++ b/src/server/core/agent.nim @@ -123,7 +123,8 @@ proc agentInteract*(cq: Conquest, name: string) = while command.replace(" ", "") != "back": command = cq.prompt.readLine() - cq.withOutput(handleAgentCommand, command) - + cq.handleAgentCommand(command) + + # Reset interactAgent field after interaction with agent is ended using 'back' command cq.interactAgent = nil diff --git a/src/server/core/server.nim b/src/server/core/server.nim index 716582c..b98881a 100644 --- a/src/server/core/server.nim +++ b/src/server/core/server.nim @@ -172,4 +172,4 @@ proc startServer*(profilePath: string) = cq.prompt.showPrompt() var command: string = cq.prompt.readLine() - cq.withOutput(handleConsoleCommand, command) + cq.handleConsoleCommand(command) diff --git a/src/server/utils.nim b/src/server/utils.nim index 7a35ced..18ebe5a 100644 --- a/src/server/utils.nim +++ b/src/server/utils.nim @@ -11,12 +11,6 @@ proc validatePort*(portStr: string): bool = except ValueError: return false -# Overwrite withOutput function to handle function arguments -proc withOutput*(cq: Conquest, outputFunction: proc(cq: Conquest, args: string), args: string) = - cq.prompt.hidePrompt() - outputFunction(cq, args) - cq.prompt.showPrompt() - # Table border characters type Cell = object