Spyder: MacOS displaying Windows icons and shortcuts

Created on 18 May 2018  路  15Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [x] Could not reproduce inside jupyter qtconsole (if console-related)
  • [x] Tried basic troubleshooting (if a bug/error)

    • [x] Restarted Spyder

    • [x] Reset preferences with spyder --reset

    • [x] Reinstalled the latest version of Anaconda

    • [x] Tried the other applicable steps from the Troubleshooting Guide

  • [x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

The Spyder is displaying windows icons and windows shortcuts on a MacOS. I have tried intalling the Spyder, ran all the resets and also reinstalled the Anaconda. Nothing helped

What steps reproduce the problem?

  1. No steps needed besides opening Spyder.


    1. 3.

What is the expected output? What do you see instead?

The UI in Spyder dedicated to MacOS with MacOS shortcuts.

Paste Traceback/Error Below (if applicable)

image
image

Versions

  • Spyder version: 3.2.8
  • Python version: 3.6.4
  • Qt version: 5.6.2
  • PyQt version: 5.6.0
  • Operating System name/version: Mac OS High Sierra Version 10.13.4

Dependencies

IPython >=4.0 : 6.2.1 (OK)
cython >=0.21 : 0.27.3 (OK)
jedi >=0.9.0 : 0.11.1 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.14.0 (OK)
pandas >=0.13.1 : 0.22.0 (OK)
psutil >=0.3 : 5.4.3 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.2 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.6 (OK)
sympy >=0.7.3 : 1.1.1 (OK)

MacOS Ux-usability Enhancement

Most helpful comment

Seems like an interesting challenge, so I am absolutely up for it.

All 15 comments

Thanks for reporting, and going through all that. This seems unlikely to be a bug, and rather simply that we've currently not yet implemented platform-specific shortcut names there. Not sure how high a priority it will be for a fix, but for now, you can remember that Ctrl is equivalent to Command on a Mac, and Alt is equivalent to option (as should be printed on your keyboard).

Oh. Thank you for the feedback! 馃憤 I will then wait for the fix

If you'd rather, and assuming @ccordoba12 thinks its a valid and good idea, you're welcome to take a shot at it yourself and we'd be glad to review a PR. I'm not sure anyone on the core dev team has ready access to a Mac to test it in any case, but we'd be glad to point to toward exactly what you'd need to change. Spyder is written in the very same Python language your code is, so presumably it shouldn't be too hard.

Sure, it's a valid concern.

Seems like an interesting challenge, so I am absolutely up for it.

So where should one start? Currently just exploring the code.

Hey, so the file spyder/widgets/shortcutssummary.py is where all the shortcut dialog related code is, and right around line 109 is where the actual label (title of the keystroke) gets set. So, a simple approach would just check for sys.platform.startswith('darwin') and if so, just .replace('Ctrl', 'Cmd') and so on with the shortcut text. Make sure you use the 3.x branch as the base for your changes so they get implemented quickly.

This seems unlikely to be a bug, and rather simply that we've currently not yet implemented platform-specific shortcut names there.

I found out that ^F1 (Control F1) for Help > Shortcuts Summary does not work, Command Tab to go to next file is bound with MacOS shortcut

I found out that ^F1 (Control F1) for Help > Shortcuts Summary does not work

Can you try Command-F1? I apparently can't test the default on Windows, since its mapped to Meta-F1, which I guess Qt substitutes Control for on Macs.

In fact, a lot of shortcuts have a Meta+<Key> assigned to them by default, and I'm not sure why other than it being a highly platform specific thing since no modern keyboards have it directly, and trying Esc, Alt, and Win to emulate it didn't work at least on Windows. Of course, that its a separate issue...

@ccordoba12 Should I create an issue? I've been wondering why there were so many Meta shortcuts ever since I started using Spyder, but I'd just assumed I was just dumb and missing an obvious way to emulate it. Perhaps the Windows key words for this purpose on Linux, and maybe Control or Command does so on macOS, but for the majority of our users unfortunately stuck on Windows this is useless and confusing to users; even if they are on Linux or Mac they might not know what the Meta key is. Therefore, it seems we should either pick proper cross-platform shortcuts for our defaults, if we don't have separate defaults per platform.

@CAM-Gerlach It's mapped to the Start or Windows key for me in Ubuntu.

I think most programs in Linux call that the super key these days.

That shortcut menu opened full screen on my 32 inch monitor with no clear indication how to close it(There were no window controls. Esc worked). I think a pop-up dialogue might work better

It's mapped to the Start or Windows key for me in Ubuntu.

I see, as I figured it might (I couldn't reliably test it in my Fedora VM). Thanks for confirming.

In any case, I really don't think its a good idea to use a key that isn't accessible from at least one, if not two of our three major OSes (and the one its certainly not accessible from being our largest), as part of around 1/4th of our default shortcuts, much less one that doesn't directly match a key on any modern keyboard and isn't one of the standard three that most users generally expect.

That shortcut menu opened full screen on my 32 inch monitor with no clear indication how to close it(There were no window controls. Esc worked).

Yup, same here on Windows. I naturally went for Esc to close, but I imagine not all users may have such an instinct and there should be at least one visible UI element to close it.

Can you try Command-F1? I apparently can't test the default on Windows, since its mapped to Meta-F1, which I guess Qt substitutes Control for on Macs.

Command F1 does not work. Meta key is indeed Control. The shortcuts with meta that I tried work.
Look forward to your design decision.

Okay, thanks @minhtriet . So it works for everything, except

^F1 (Control F1) for Help > Shortcuts Summary does not work

Also, just to clarify, in the UI (the menu items, the shortcuts summary, and/or the keyboard shortcuts editor in the preferences), is Meta displayed as Meta or ^/Control?

Finally, maybe this has changed since my days using Macs (I was a Mac user my whole life until 2012-2013), but I recall very few applications used Control for primary shortcuts (other than as a modifier key for performing other actions, and of course Control-clicking) besides a few Linux ports. However, its been a while and Macs were never my primary development environment鈥攁ny thoughts on this?

Command Tab to go to next file is bound with MacOS shortcut

Ah, that's a problem鈥攊t should be bound to ^ Tab on Mac instead. I thought there was an issue somewhere about that, but I can't find it...it might even be fixed in the development branch (Spyder 3.3) already.

Hey,

So the menu item displays ^.

The shortcut preferences are also using the correct symbolism. The shortcut preferences are using ctrl. The shortcut summary on a Mac with touchbar will have the touchbar display only the Esc item, which to an extent is of assistance. See pictures below:
screen shot 2018-06-09 at 07 16 32
screen shot 2018-06-09 at 07 16 04
screen shot 2018-06-09 at 07 15 55
screen shot 2018-06-09 at 07 15 17

So, in summary on a Mac, it seems shortcuts are displayed with their correct Mac-localized symbols (Command, Option, Control) in the menus and Shortcut Editor, while in the Shortcut Summary, they are rendered with the default Linux names (Ctrl, Alt, Meta). That seems consistant with @GertL posted above, and what they said they would work on.

I guess the other separate issue I see, if @ccordoba12 agrees, is that right now a substantial fraction (~1/4) of the default shortcuts are broken and inapplicable on Windows, apparently our most popular OS judging from our bug tracker (i.e. anything with Meta, since no application-accessible Meta key exists for the OS), while on Mac, those shortcuts are correctly mapped to ^ although that modifier isn't conventionally used much (but would still be well within the lexicon of an experienced Mac user), and on Linux its presumably much more common and accessible. Options to resolve would be either remapping those shortcuts to a common key, or localizing the default shortcuts to the user's OS, i.e. using different shortcuts or substituting another key for Meta on Windows, and possibly reconsidering some of the choices on Mac as well (more functional and OS-appropriate, but adding significant complexity and less cross-platform commonality).

Was this page helpful?
0 / 5 - 0 ratings