pty-wrap 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +15 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20,6 +20,8 @@ function resolveCommand(cmd) {
20
20
  }
21
21
  let seq = 0;
22
22
  const topic = `sessions/${SESSION_ID}/stream`;
23
+ let skipOutputUntilStable = false;
24
+ let skipOutputTimer = null;
23
25
  const client = mqtt.connect(MQTT_URL, {
24
26
  clientId: `pty-wrapper-${SESSION_ID}`,
25
27
  clean: false,
@@ -56,7 +58,9 @@ client.on('connect', () => {
56
58
  env: process.env,
57
59
  });
58
60
  ptyProcess.onData((data) => {
59
- publish('output', data);
61
+ if (!skipOutputUntilStable) {
62
+ publish('output', data);
63
+ }
60
64
  process.stdout.write(data);
61
65
  });
62
66
  if (process.stdin.isTTY) {
@@ -65,6 +69,16 @@ client.on('connect', () => {
65
69
  process.stdin.resume();
66
70
  process.stdin.on('data', (data) => {
67
71
  const str = data.toString();
72
+ // Ctrl+O (0x0f) triggers Claude Code UI toggle - skip subsequent output refresh
73
+ if (str === '\x0f') {
74
+ skipOutputUntilStable = true;
75
+ if (skipOutputTimer)
76
+ clearTimeout(skipOutputTimer);
77
+ skipOutputTimer = setTimeout(() => {
78
+ skipOutputUntilStable = false;
79
+ skipOutputTimer = null;
80
+ }, 500);
81
+ }
68
82
  publish('input', str);
69
83
  ptyProcess.write(str);
70
84
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pty-wrap",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "PTY wrapper for capturing terminal sessions via MQTT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",