Skip to content

ShowParamterHelp is bound to Alt+h by default which doesn't work on macOS #2242

Open
@SteveL-MSFT

Description

@SteveL-MSFT
Member

Environment

PS version: 7.2.0-preview.3
PSReadline version: 2.2.0-beta2
os: Darwin mmomalife.northamerica.corp.microsoft.com 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
PS file version: 7.2.0.0
HostName: ConsoleHost
BufferWidth: 381
BufferHeight: 94

By default 2.2-beta2 binds Alt+h to ShowParameterHelp, but Alt+h on macOS prints Unicode 0xCB99 instead of calling the key handler. There is already an issue with .NET in not catching some keyboard combinations correctly on Unix systems. For now, it may make sense to pick a different default binding that works on Windows and Linux/macOS. Perhaps F2?

Activity

ghost added
Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
on Feb 23, 2021
daxian-dbw

daxian-dbw commented on Feb 24, 2021

@daxian-dbw
Member

@theJasonHelmick and I had a discussion about this on Monday. We thought about choosing a different key binding, but decided to postpone the change.
It works fine on Linux, but not on macOS because of #1075. There are many existing default bindings today using combination keys with Alt, and all of them are not working on macOS. So we should fix #1075 as it's the root cause. But I'm fine that we choose different default binding for parameter help. F2 is already taken, to switch between prediction views.

changed the title [-]ShowParamterHelp is bound to Alt+h by default which doesn't work on macOS (maybe Linux as well)[/-] [+]ShowParamterHelp is bound to Alt+h by default which doesn't work on macOS[/+] on Feb 24, 2021
adityapatwardhan

adityapatwardhan commented on Feb 24, 2021

@adityapatwardhan
Member

How about Ctrl+F1. Still related to F1 so keeps the help chords together?

theJasonHelmick

theJasonHelmick commented on Feb 24, 2021

@theJasonHelmick
Collaborator

The same problem exists with ALT-a as well - any ALT key combinations on MAc. I have remapped them as Ctrl-L and Ctrl-k. I'm not recommending these mappings, but more to @adityapatwardhan point - I think that loading up the function keys with ctrl options might not work well - as a Mac user, one method of accessing the function keys is to press Fn + the function key - this would make it Fn+Ctrl+F1 - which is a stretch.

mklement0

mklement0 commented on Feb 1, 2023

@mklement0

It's not ideal, but a one-time configuration of the macOS terminal apps makes the Alt-based shortcuts work:

See #1075 (comment)

andyleejordan

andyleejordan commented on Feb 1, 2023

@andyleejordan
Member

Edit: Oops yeah exactly what @mklement0 linked to! Sorry didn't read, it was just the notification that pulled me over lol.

Have you all tried setting "Use option as meta key" in macOS's terminal settings? This works for me, been doing it since 2012 to get all my Alt- combos in terminal Emacs working 😆

Screenshot 2023-02-01 at 9 51 26 AM

mklement0

mklement0 commented on Feb 1, 2023

@mklement0

Thanks, @andschwa, let me just duplicate the info from the linked comment for convenience here, so as to also cover iTerm2 users:

Preferences > Profiles > (profile of interest) > Keys > Left Option key: / Right Option key:

Choose ESC+.

image

added
Issue-KeyboardLayoutIssues related to dead keys with some keyboard layout.
Area-KeyHandlersLabel for issues related to key handlers
OS-macOSThe issue happens on macOS only.
and removed
Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
on Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-KeyHandlersLabel for issues related to key handlersIssue-KeyboardLayoutIssues related to dead keys with some keyboard layout.OS-macOSThe issue happens on macOS only.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @daxian-dbw@mklement0@andyleejordan@SteveL-MSFT@theJasonHelmick

      Issue actions

        ShowParamterHelp is bound to Alt+h by default which doesn't work on macOS · Issue #2242 · PowerShell/PSReadLine