codeep 1.1.30 → 1.1.31

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.
@@ -14,6 +14,7 @@ export type KeyHandler = (event: KeyEvent) => void;
14
14
  export declare class Input {
15
15
  private handlers;
16
16
  private rl;
17
+ private dataHandler;
17
18
  /**
18
19
  * Start listening for input
19
20
  */
@@ -5,6 +5,7 @@
5
5
  export class Input {
6
6
  handlers = [];
7
7
  rl = null;
8
+ dataHandler = null;
8
9
  /**
9
10
  * Start listening for input
10
11
  */
@@ -19,15 +20,21 @@ export class Input {
19
20
  // \x1b[?1000h - enable basic mouse tracking
20
21
  // \x1b[?1006h - enable SGR extended mouse mode
21
22
  process.stdout.write('\x1b[?1000h\x1b[?1006h');
22
- process.stdin.on('data', (data) => {
23
+ this.dataHandler = (data) => {
23
24
  const event = this.parseKey(data);
24
25
  this.emit(event);
25
- });
26
+ };
27
+ process.stdin.on('data', this.dataHandler);
26
28
  }
27
29
  /**
28
30
  * Stop listening
29
31
  */
30
32
  stop() {
33
+ // Remove data listener
34
+ if (this.dataHandler) {
35
+ process.stdin.removeListener('data', this.dataHandler);
36
+ this.dataHandler = null;
37
+ }
31
38
  // Disable mouse tracking
32
39
  process.stdout.write('\x1b[?1006l\x1b[?1000l');
33
40
  if (process.stdin.isTTY) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",