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