@jx0/jmux 0.3.2 → 0.3.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx0/jmux",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "The terminal workspace for agentic development",
5
5
  "type": "module",
6
6
  "bin": {
@@ -65,8 +65,8 @@ export class InputRouter {
65
65
  const mouse = parseSgrMouse(data);
66
66
  if (mouse && this.sidebarVisible) {
67
67
  if (mouse.x <= this.opts.sidebarCols) {
68
- // Click in sidebar region
69
- if (!mouse.release) {
68
+ // Click in sidebar region (ignore drags — button bit 5 = motion)
69
+ if (!mouse.release && (mouse.button & 32) === 0) {
70
70
  this.opts.onSidebarClick(mouse.y - 1); // 0-indexed row
71
71
  }
72
72
  return; // Consume sidebar mouse events
package/src/main.ts CHANGED
@@ -12,7 +12,7 @@ import { homedir } from "os";
12
12
 
13
13
  // --- CLI commands (run and exit before TUI) ---
14
14
 
15
- const VERSION = "0.3.1";
15
+ const VERSION = "0.3.3";
16
16
 
17
17
  const HELP = `jmux — a persistent session sidebar for tmux
18
18
 
@@ -143,6 +143,7 @@ const mainCols = sidebarVisible ? cols - SIDEBAR_TOTAL : cols;
143
143
  // Enter alternate screen, raw mode, enable mouse tracking
144
144
  process.stdout.write("\x1b[?1049h");
145
145
  process.stdout.write("\x1b[?1000h"); // mouse button tracking
146
+ process.stdout.write("\x1b[?1002h"); // mouse drag tracking
146
147
  process.stdout.write("\x1b[?1006h"); // SGR extended mouse mode
147
148
  if (process.stdin.setRawMode) {
148
149
  process.stdin.setRawMode(true);
@@ -307,7 +308,18 @@ const inputRouter = new InputRouter(
307
308
 
308
309
  let writesPending = 0;
309
310
 
311
+ // OSC 52 clipboard: \x1b]52;...;...\x07 or \x1b]52;...;...\x1b\\
312
+ const OSC52_RE = /\x1b\]52;[^;]*;[^\x07\x1b]*(?:\x07|\x1b\\)/g;
313
+
310
314
  pty.onData((data: string) => {
315
+ // Pass OSC 52 clipboard sequences directly to the outer terminal
316
+ const osc52Matches = data.match(OSC52_RE);
317
+ if (osc52Matches) {
318
+ for (const seq of osc52Matches) {
319
+ process.stdout.write(seq);
320
+ }
321
+ }
322
+
311
323
  writesPending++;
312
324
  bridge.write(data).then(() => {
313
325
  writesPending--;
@@ -450,6 +462,7 @@ async function start(): Promise<void> {
450
462
  function cleanup(): void {
451
463
  control.close().catch(() => {});
452
464
  process.stdout.write("\x1b[?1000l"); // disable mouse button tracking
465
+ process.stdout.write("\x1b[?1002l"); // disable mouse drag tracking
453
466
  process.stdout.write("\x1b[?1006l"); // disable SGR mouse mode
454
467
  process.stdout.write("\x1b[?25h");
455
468
  process.stdout.write("\x1b[?1049l");