-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use getShellStartCommand to get the default command #128
Conversation
This looks good except for missing updated tests otherwise 👍 |
I added a sync version using |
My tests show that if the user doesn't have I'm thinking that ~300ms is not worth the more accurate default. If you can get Atom to load the config asynchronously it might be worth it. |
This comment has been minimized.
This comment has been minimized.
@UziTech For the tests, could you make |
You can only mock properties and methods of an object. If you want to mock an imported function you will have to inject a spy some how. something like: async function getShellStartCommand (find = which) {
...
find('pwsh')
...
}
...
it('test', () => {
const spy = jasmine.createSpy('which')
getShellStartCommand(spy)
...
}) |
This only needs the tests. If you can help with that, I would appreciate it. |
atom.config.observe('x-terminal.spawnPtySettings.command', () => { | ||
atom.config.set('x-terminal.spawnPtySettings.autoCommand', false) | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also observe autoCommand
and reset command
if it is checked?
type: 'boolean', | ||
default: configDefaults.autoCommand, | ||
profileData: { | ||
defaultProfile: configDefaults.command, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultProfile: configDefaults.command, | |
defaultProfile: configDefaults.autoCommand, |
🎉 This issue has been resolved in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
On Windows, as the default value for the config, this uses pwsh (PowerShellCore) if available on a system. If not it will use powershell, and in the end, it will use cmd.