mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-13 12:57:12 -07:00
fix(hooks): force child_process PTY in getPty and use explicit hook names in tests
This commit is contained in:
@@ -1842,7 +1842,7 @@ console.log(JSON.stringify({
|
||||
settings: {
|
||||
hooksConfig: {
|
||||
enabled: true,
|
||||
disabled: [normalizePath(disabledCmd)],
|
||||
disabled: ['hook-b'],
|
||||
},
|
||||
hooks: {
|
||||
BeforeTool: [
|
||||
@@ -1850,11 +1850,13 @@ console.log(JSON.stringify({
|
||||
hooks: [
|
||||
{
|
||||
type: 'command',
|
||||
name: 'hook-a',
|
||||
command: enabledCmd,
|
||||
timeout: 60000,
|
||||
},
|
||||
{
|
||||
type: 'command',
|
||||
name: 'hook-b',
|
||||
command: disabledCmd,
|
||||
timeout: 60000,
|
||||
},
|
||||
@@ -1914,7 +1916,7 @@ console.log(JSON.stringify({
|
||||
settings: {
|
||||
hooksConfig: {
|
||||
enabled: true,
|
||||
disabled: [normalizePath(disabledCmd)],
|
||||
disabled: ['multi-hook-disabled'],
|
||||
},
|
||||
hooks: {
|
||||
BeforeTool: [
|
||||
@@ -1922,11 +1924,13 @@ console.log(JSON.stringify({
|
||||
hooks: [
|
||||
{
|
||||
type: 'command',
|
||||
name: 'multi-hook-active',
|
||||
command: activeCmd,
|
||||
timeout: 60000,
|
||||
},
|
||||
{
|
||||
type: 'command',
|
||||
name: 'multi-hook-disabled',
|
||||
command: disabledCmd,
|
||||
timeout: 60000,
|
||||
},
|
||||
|
||||
@@ -18,6 +18,9 @@ export interface PtyProcess {
|
||||
}
|
||||
|
||||
export const getPty = async (): Promise<PtyImplementation> => {
|
||||
if (process.env['GEMINI_PTY_INFO'] === 'child_process') {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const lydell = '@lydell/node-pty';
|
||||
const module = await import(lydell);
|
||||
|
||||
Reference in New Issue
Block a user