hsh19900502 1.0.20 → 1.0.21

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.
@@ -3,6 +3,7 @@ import 'zx/globals';
3
3
  import chalk from 'chalk';
4
4
  import inquirerAutocomplete from 'inquirer-autocomplete-prompt';
5
5
  import { readConfig } from '../util.js';
6
+ import { spawn } from 'child_process';
6
7
  // Register autocomplete prompt
7
8
  inquirer.registerPrompt('autocomplete', inquirerAutocomplete);
8
9
  let reposConfig;
@@ -71,7 +72,26 @@ export const openIDE = async (ideType) => {
71
72
  const selectedProject = secondLevelAnswer.project;
72
73
  const projectPath = reposConfig[currentCategory][selectedProject];
73
74
  if (ideType === 'claude') {
74
- await $ `cd ${projectPath} && claude`;
75
+ // Use spawn with inherited stdio to support interactive TTY
76
+ const claudeProcess = spawn('claude', [], {
77
+ cwd: projectPath,
78
+ stdio: 'inherit', // Inherit stdin, stdout, stderr from parent process
79
+ shell: true,
80
+ });
81
+ // Wait for the process to exit
82
+ await new Promise((resolve, reject) => {
83
+ claudeProcess.on('close', (code) => {
84
+ if (code === 0) {
85
+ resolve();
86
+ }
87
+ else {
88
+ reject(new Error(`Claude process exited with code ${code}`));
89
+ }
90
+ });
91
+ claudeProcess.on('error', (error) => {
92
+ reject(error);
93
+ });
94
+ });
75
95
  return;
76
96
  }
77
97
  // Open project in IDE
package/dist/hsh.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hsh19900502",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -3,6 +3,7 @@ import 'zx/globals';
3
3
  import chalk from 'chalk';
4
4
  import inquirerAutocomplete from 'inquirer-autocomplete-prompt';
5
5
  import { readConfig } from '../util.js';
6
+ import { spawn } from 'child_process';
6
7
 
7
8
  interface ReposConfig {
8
9
  [key: string]: {
@@ -98,7 +99,26 @@ export const openIDE = async (ideType: 'cursor' | 'claude') => {
98
99
  const projectPath = reposConfig[currentCategory][selectedProject];
99
100
 
100
101
  if(ideType === 'claude') {
101
- await $`cd ${projectPath} && claude`;
102
+ // Use spawn with inherited stdio to support interactive TTY
103
+ const claudeProcess = spawn('claude', [], {
104
+ cwd: projectPath,
105
+ stdio: 'inherit', // Inherit stdin, stdout, stderr from parent process
106
+ shell: true,
107
+ });
108
+
109
+ // Wait for the process to exit
110
+ await new Promise<void>((resolve, reject) => {
111
+ claudeProcess.on('close', (code) => {
112
+ if (code === 0) {
113
+ resolve();
114
+ } else {
115
+ reject(new Error(`Claude process exited with code ${code}`));
116
+ }
117
+ });
118
+ claudeProcess.on('error', (error) => {
119
+ reject(error);
120
+ });
121
+ });
102
122
  return;
103
123
  }
104
124
  // Open project in IDE