mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
Fix powershell encoding.
This commit is contained in:
@@ -429,7 +429,11 @@ describe('getShellConfiguration', () => {
|
|||||||
delete process.env['ComSpec'];
|
delete process.env['ComSpec'];
|
||||||
const config = getShellConfiguration();
|
const config = getShellConfiguration();
|
||||||
expect(config.executable).toBe('powershell.exe');
|
expect(config.executable).toBe('powershell.exe');
|
||||||
expect(config.argsPrefix).toEqual(['-NoProfile', '-Command']);
|
expect(config.argsPrefix).toEqual([
|
||||||
|
'-NoProfile',
|
||||||
|
'-Command',
|
||||||
|
'$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;',
|
||||||
|
]);
|
||||||
expect(config.shell).toBe('powershell');
|
expect(config.shell).toBe('powershell');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -438,7 +442,11 @@ describe('getShellConfiguration', () => {
|
|||||||
process.env['ComSpec'] = cmdPath;
|
process.env['ComSpec'] = cmdPath;
|
||||||
const config = getShellConfiguration();
|
const config = getShellConfiguration();
|
||||||
expect(config.executable).toBe('powershell.exe');
|
expect(config.executable).toBe('powershell.exe');
|
||||||
expect(config.argsPrefix).toEqual(['-NoProfile', '-Command']);
|
expect(config.argsPrefix).toEqual([
|
||||||
|
'-NoProfile',
|
||||||
|
'-Command',
|
||||||
|
'$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;',
|
||||||
|
]);
|
||||||
expect(config.shell).toBe('powershell');
|
expect(config.shell).toBe('powershell');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -448,7 +456,11 @@ describe('getShellConfiguration', () => {
|
|||||||
process.env['ComSpec'] = psPath;
|
process.env['ComSpec'] = psPath;
|
||||||
const config = getShellConfiguration();
|
const config = getShellConfiguration();
|
||||||
expect(config.executable).toBe(psPath);
|
expect(config.executable).toBe(psPath);
|
||||||
expect(config.argsPrefix).toEqual(['-NoProfile', '-Command']);
|
expect(config.argsPrefix).toEqual([
|
||||||
|
'-NoProfile',
|
||||||
|
'-Command',
|
||||||
|
'$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;',
|
||||||
|
]);
|
||||||
expect(config.shell).toBe('powershell');
|
expect(config.shell).toBe('powershell');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -457,7 +469,11 @@ describe('getShellConfiguration', () => {
|
|||||||
process.env['ComSpec'] = pwshPath;
|
process.env['ComSpec'] = pwshPath;
|
||||||
const config = getShellConfiguration();
|
const config = getShellConfiguration();
|
||||||
expect(config.executable).toBe(pwshPath);
|
expect(config.executable).toBe(pwshPath);
|
||||||
expect(config.argsPrefix).toEqual(['-NoProfile', '-Command']);
|
expect(config.argsPrefix).toEqual([
|
||||||
|
'-NoProfile',
|
||||||
|
'-Command',
|
||||||
|
'$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;',
|
||||||
|
]);
|
||||||
expect(config.shell).toBe('powershell');
|
expect(config.shell).toBe('powershell');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -465,7 +481,11 @@ describe('getShellConfiguration', () => {
|
|||||||
process.env['ComSpec'] = 'C:\\Path\\To\\POWERSHELL.EXE';
|
process.env['ComSpec'] = 'C:\\Path\\To\\POWERSHELL.EXE';
|
||||||
const config = getShellConfiguration();
|
const config = getShellConfiguration();
|
||||||
expect(config.executable).toBe('C:\\Path\\To\\POWERSHELL.EXE');
|
expect(config.executable).toBe('C:\\Path\\To\\POWERSHELL.EXE');
|
||||||
expect(config.argsPrefix).toEqual(['-NoProfile', '-Command']);
|
expect(config.argsPrefix).toEqual([
|
||||||
|
'-NoProfile',
|
||||||
|
'-Command',
|
||||||
|
'$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;',
|
||||||
|
]);
|
||||||
expect(config.shell).toBe('powershell');
|
expect(config.shell).toBe('powershell');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -552,7 +552,11 @@ export function getShellConfiguration(): ShellConfiguration {
|
|||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
executable: comSpec,
|
executable: comSpec,
|
||||||
argsPrefix: ['-NoProfile', '-Command'],
|
argsPrefix: [
|
||||||
|
'-NoProfile',
|
||||||
|
'-Command',
|
||||||
|
'$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;',
|
||||||
|
],
|
||||||
shell: 'powershell',
|
shell: 'powershell',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -561,7 +565,11 @@ export function getShellConfiguration(): ShellConfiguration {
|
|||||||
// Default to PowerShell for all other Windows configurations.
|
// Default to PowerShell for all other Windows configurations.
|
||||||
return {
|
return {
|
||||||
executable: 'powershell.exe',
|
executable: 'powershell.exe',
|
||||||
argsPrefix: ['-NoProfile', '-Command'],
|
argsPrefix: [
|
||||||
|
'-NoProfile',
|
||||||
|
'-Command',
|
||||||
|
'$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;',
|
||||||
|
],
|
||||||
shell: 'powershell',
|
shell: 'powershell',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user