-
Notifications
You must be signed in to change notification settings - Fork 500
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
not using the Legacy Psreadline experience leads to "custom key handler"-error #4196
Comments
Don't know if this helps:
|
What custom key handler are you using? I don't expect the legacy readline to be a stable experience, it's just a fallback for debugging and is not covered in tests. |
I am at a loss, how would I find out? (I am not aware changing the key handler...) |
Mm, try running |
d'oh! Could have guessed this one... Thank you.
Just updating to v12.0.1 to see whether this fixes things - This did appear after the most recent update to v11.x |
ok. no change after update. Shall I report this to Jan as well? (I have no issues with this setup on Windows Terminal, just in VsCode for some reason and only in the terminal instance created by PowerShell Extension... Edit: the Normal PowerShell Terminal that starts with VsCode works fine as well. |
Let's try without |
Yes, this works - not calling this line restores functionality
|
Ok, seems like a bug with the oh-my-posh key handler, I would recommend reaching out to those developers to get it fixed! |
This issue has been marked as external. It has been automatically closed for housekeeping purposes. |
Sorry, did not mean to allow the bot to close this, I'm actively investigating it. I was able to repro, though only with Windows PowerShell. |
@DEberhardt Please let me know when you get a change to try PowerShell 7 AKA PowerShell Core and if it repros there too. I can repro but only with PowerShell 5.1 AKA Windows PowerShell, and what happens is weird, I'm getting this exception:
With this stacktrace:
|
Presumably from here: public static void InvokePrompt(ConsoleKeyInfo? key = null, object arg = null) |
@DEberhardt Responding to JanDeDobbeleer/oh-my-posh#2910 (comment) here so we don't flood oh-my-posh. Regarding your profile not loading with PowerShell 7, please note that PowerShell 5.1 and 7 load (some) different profile paths. I would run |
Don't mind me, I have forgotten how profiles work. 😄 - Having never used PowerShell Core in VsCode (still working with the AzureAd module 😐 ), I had never created a Profile for VsCode, only for the normal terminal. With the Extension Terminal on PowerShell 7 Core (x64) I do not get an error |
Ok cool, thanks for confirming this is just a PowerShell 5.1 issue. |
Type: Bug
Install PSReadline v2.2.6
Use VsCode
Use PowerShell or PowerShellPreview
Use PowerShell Extension terminal session that is opened to you
[2022-10-02 11:09:22]❯ get-moduleAn exception occurred in custom key handler, see $error for more information: Object reference not set to an instance of an object.
No command I enter (incl. $Error[0].Exception) leads anywhere.
If I then disable the live PSreadline experience (i.e. switch on the "legacy PSreadline experience" in the settings and restart the terminal session, it works fine.
Problem #1) - I can't close the terminal session as it de-facto disables the extensions
Problem #2) - I can't use it in legacy mode as most of the PsReadLine goodies do not work anymore
Problem #3) - I can't use it in normal operation mode
What can be done here?
Anything else I can do to troubleshoot this?
Extension version: 2022.9.2
VS Code version: Code 1.71.2 (74b1f979648cc44d385a2286793c226e611f59e7, 2022-09-14T21:03:37.738Z)
OS version: Windows_NT x64 10.0.22623
Modes:
Sandboxed: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: