Defining Actions and Previews #73
Replies: 4 comments 4 replies
-
$option = [PowerShellRun.SelectorOption]::new()
$option.Theme.PreviewEnable = $false
Set-PSRunDefaultSelectorOption $optionThis is the only way to disable the preview and calling Probably is it related to updating the configuration in a session? |
Beta Was this translation helpful? Give feedback.
-
|
This is the full theming section of my configuration script. $roundBorder = [PowerShellRun.BorderSymbol]::new()
$roundBorder.TopLeft = '╔' #'╭'
$roundBorder.TopRight = '╗' #'╮'
$roundBorder.BottomRight = '╝' #'╰'
$roundBorder.BottomLeft ='╚' #'╯'
$roundBorder.Vertical = '║'
$roundBorder.Horizontal = '═'
$option = [PowerShellRun.SelectorOption]::new()
$option.Theme.PreviewEnable = $True
$option.Prompt = '🤓 > '
$option.Theme.Cursor = '▸ '
$option.Theme.CursorForegroundColor = [PowerShellRun.FontColor]::Cyan
$option.Theme.PreviewEnable = $false
$option.Theme.PreviewBorderForegroundColor = [PowerShellRun.FontColor]::BrightYellow
$option.Theme.CanvasBorderForegroundColor = [PowerShellRun.FontColor]::Yellow
$option.Theme.CanvasBorderSymbol = $roundBorder
$option.Theme.PreviewBorderSymbol = $roundBorder
$option.Theme.ActionWindowBorderSymbol = $roundBorder
$option.Theme.ActionWindowBorderForegroundColor = [PowerShellRun.FontColor]::BrightYellow
$option.Theme.SearchBarBorderForegroundColor = [PowerShellRun.FontColor]::BrightGreen
$option.Theme.PromptForegroundColor = [PowerShellRun.FontColor]::BrightGreen
Set-PSRunDefaultSelectorOption -Option $optionBut something isn't getting set. |
Beta Was this translation helpful? Give feedback.
-
|
In a new session without my configuration script, I can see the preview is enabled. Pasting my option commands in a new setting shows the desired setting. I wonder if this is a scoping issue. |
Beta Was this translation helpful? Give feedback.
-
|
I see now that I was a little sloppy with my code. Preview is working now. So my next question is about customizing the action window. I saw a reference in the README file about creating custom selectors, but it didn't give me enough information. For example, in the screen shot, is it possible to add an action to do something else with the selected item? In this case it is a folder, but I might want to customize an action for a file or other entry type. |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
This may be two different topics, but they are related. If I run
Invoke-PSRunwith minimal settings, I get the default behavior with a preview window and action keys.However, in my customized configuration, I am defining a new selector option so that I can define theme settings.
However, this ends up turning off the preview. I found this setting and tried enabling it.
But this doesn't seem to have any effect. I wonder if I need to define action keys, and if so how? Part of my goal is to be able to create an additional preview action key for certain items. Can you provide some examples?
Beta Was this translation helpful? Give feedback.
All reactions