Using PowerShell core as shell #6209
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It looks like you're trying to pass command line flags to pwsh.exe in your config.toml file but are running into issues with the syntax. One solution could be to use double dashes (--) to separate the pwsh.exe flags from the shell flags. For example, you could try modifying your shell array to look something like this: css I hope this helps! Let me know if you have any further questions. |
Beta Was this translation helpful? Give feedback.
-
it works for me. shell = ["pwsh.exe","-NoLogo","-NoProfile","-NoProfileLoadTime","-Command","$PSStyle.OutputRendering='PlainText';"] |
Beta Was this translation helpful? Give feedback.
-
Here is my solution. Hopefully it will help others. I wrote a shell script for Helix called $PSModuleAutoloadingPreference = 'None';
$fromPipeLine = @($input);
$code = $args;
Import-Module Microsoft.PowerShell.Utility;
$Error.Clear();
try {
$expr = if ($fromPipeLine.Count -gt 0) { '$fromPipeLine | ' + $code } else { $code };
Invoke-Expression $expr
}
catch {
$Error[0].Exception.ErrorRecord.Exception.Message
} Then I set the editor shell to the above PowerShell script: [editor]
shell = ["pwsh", "-NoLogo", "-NoProfile", "-NonInteractive", "-File", "C:\\Users\\my_username\\pwsh_helix.ps1"] Therefore we aren't sending our commands straight to To make piping easier, I mapped pipe in normal mode to do this: [keys.normal]
"|" = "@:pipe ''<left>" so I can select text using So after selecting text, if I had the following two lines selected:
and then did
Similarly if I had the following text selected: * DONE eat
* TODO pray
* DONE love Then I can get all the todo tasks by doing The single quotes after |
Beta Was this translation helpful? Give feedback.
it works for me.
Reference