User's input message inputs double characters
for instance, If the user types "hi" the input is taken as "hhii"
This has been reproduced and the root cause is confirmed: onData handlers accumulate across shell restarts in ContainerManager because the previous listener is never disposed before a new one is registered. Every restart stacks another handler, so each keystroke gets written to stdin N times where N is the number of restarts.
Two PRs are open that fix this:
- PR #3 (
bugfix/user-inputby shreehari-lyzr) — disposes the previousonDatadisposable before each new registration inContainerManager. Clean and explicit. - PR #10 (
fix/terminalby tsj2003) — registers a single listener inTerminalManagerconstructor and routes through a swappable callback property.
Both work, but only one should merge to avoid a conflict. Recommend reviewing PR #3 first given it more directly targets the ContainerManager call sites where the stacking happens.
Assigning @shreyas-lyzr to follow through on closing this once the chosen PR lands.
There are currently two open PRs addressing this bug with different approaches:
- PR #3 (
shreehari-lyzr): Tracks anonDataDisposableinContainerManagerand callsdispose()before each newterminal.onData()registration acrossstartGitclaw,startShell, andstartAgent. - PR #10 (
tsj2003): Registersxterm.onDataexactly once inTerminalManager's constructor and routes all input through a replaceabledataHandlerproperty, so callers setdataHandlerrather than registering new listeners.
PR #10's approach is slightly more defensive — it structurally prevents listener stacking rather than relying on callers to dispose correctly. However, both are valid fixes.
Recommendation: pick one approach and close the other with a comment explaining the decision, to avoid a double-fix or merge conflict in terminal.ts. If PR #10 is merged, PR #3's container.ts changes (the onDataDisposable per-restart pattern) may still be worth keeping as an extra safety layer, but the terminal.ts changes would conflict.
Assigned to @shreyas-lyzr to decide which PR to land.