marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
8.04k stars 290 forks source link

Keyboard shortcut `Ctrl + Shift + 0` not working | Windows | For cell movement and markdown conversion (default mapped) #2778

Open Haleshot opened 3 weeks ago

Haleshot commented 3 weeks ago

Describe the bug

The keyboard shortcut Ctrl + Shift + 0 does not function as expected in specific contexts:

  1. In the Creation and Ordering section, it fails to move a cell down.
  2. In the Markdown section, it fails to convert text to code.

All other shortcuts work as expected, and the "Move cell down" function operates correctly when accessed through the UI options (right clicking on the UI cell block to get a bunch of options > move cell down). This indicates the issue is isolated to the Ctrl + Shift + 0 shortcut recognition, rather than the underlying functionality.

Environment

{
  "marimo": "0.9.14",
  "OS": "Windows",
  "OS Version": "11",
  "Processor": "AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD",
  "Python Version": "3.11.4",
  "Binaries": {
    "Browser": "128.0.6613.120",
    "Node": "v18.17.0"
  },
  "Dependencies": {
    "click": "8.1.7",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.1",
    "markdown": "3.6",
    "narwhals": "1.10.0",
    "packaging": "24.0",
    "psutil": "5.9.8",
    "pygments": "2.18.0",
    "pymdown-extensions": "10.8.1",
    "pyyaml": "6.0.1",
    "ruff": "0.6.0",
    "starlette": "0.37.2",
    "tomlkit": "0.12.5",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.29.0",
    "websockets": "12.0"
  },
  "Optional Dependencies": {
    "altair": "5.4.1",
    "anywidget": "0.9.13",
    "duckdb": "1.1.1",
    "pandas": "2.2.2",
    "polars": "1.11.0",
    "pyarrow": "17.0.0"
  }
}

Code to reproduce

Issue pertains to keyboard shortcut functionality rather than code execution.

Hello world program to run for reference ```python import marimo __generated_with = "0.9.14" app = marimo.App(width="medium") @app.cell def __(mo): mo.md("Hello World!") return @app.cell def __(): import marimo as mo return (mo,) if __name__ == "__main__": app.run() ```
mscolnick commented 3 weeks ago

Which browser? And can you help check other browsers if they work?

Can you also check you haven't overridden these yourself?

Haleshot commented 3 weeks ago

Which browser? And can you help check other browsers if they work?

Can you also check you haven't overridden these yourself?

Checked in Edge and Chrome (I have them), doesn't seem to work. Reset all my keyboard custom shortcuts (didn't have many before).

my marimo config show (removed the API keys) fyi: ```bash [save] autosave = "after_delay" format_on_save = false autosave_delay = 1000 [runtime] on_cell_change = "autorun" auto_instantiate = true auto_reload = "off" [keymap] preset = "default" [keymap.overrides] [ai] rules = "Always use type hints, use polars over pandas, usage of good interactive visualization libraries like altair, bokeh, plotly, etc." [ai.google] [ai.anthropic] [ai.open_ai] api_key = "" base_url = "https://api.groq.com/openai/v1" model = "llama-3.1-70b-versatile" [experimental] multi_column = true [formatting] line_length = 79 [package_management] add_script_metadata = true manager = "uv" [server] follow_symlink = false browser = "default" [display] dataframes = "rich" code_editor_font_size = 14 default_width = "medium" theme = "light" cell_output = "above" [completion] copilot = "github" activate_on_typing = true codeium_api_key = "" ```

Edit: Do you think it has to do with Windows? Is it working on your end? I did notice in the source code how commands get picked up depending on the OS. (But not sure why 0 is not getting registered and Move Cell up which has 9 gets picked up).

mscolnick commented 3 weeks ago

Ok, I'll try to repo, otherwise possibly a windows issue.

Haleshot commented 3 weeks ago

Ok, I'll try to repo, otherwise possibly a windows issue.

Update: tried it in my friend's MacBook; works there. It seems to be a Windows issue. Yet to try in Linux environment.

mscolnick commented 3 weeks ago

Thank for checking! This is helpful