Skip to content

Asynchronous Execution with cmd() Fails #25

@shangzhongq

Description

@shangzhongq

Issue: Asynchronous commands (e.g., after) executed via tcl.cmd() do not resolve correctly, returning undefined despite outputting to stdout.

Impact: Breaks asynchronous Tcl commands, limiting scripting capabilities.

Reproduction:

const Tcl = require('tcl').Tcl;
const tcl = new Tcl();
(async () => {
try {
const result = await tcl.cmd('puts [after 1000 "Async test"]');
console.log('Result:', result);
} catch (err) {
console.error('Error:', err.message);
}
})();

Observed Output: after#0\nResult: undefined

Expected Output: Async test\nResult: Async test

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions