sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
16.03k stars 373 forks source link

Panic when creating basic `keymap.toml` #929

Closed mxmerz closed 6 months ago

mxmerz commented 6 months ago

What system are you running Yazi on?

macOS

What terminal are you running Yazi in?

iTerm

Did you try the latest code to see if this problem got fixed?

Not tried, and I'll explain why below

yazi --debug output

```sh error: unexpected argument '--debug' found tip: to pass '--debug' as a value, use '-- --debug' Usage: yazi [OPTIONS] [ENTRY] For more information, try '--help'. ```

Describe the bug

When I set up the keymap.toml as described below, yazi crashes on startup:

$ yazi
thread 'main' panicked at yazi-config/src/keymap/keymap.rs:85:59:
called `Result::unwrap()` on an `Err` value: Error { inner: Error { inner: TomlError { message: "missing field `exec`", original: Some("\"$schema\" = \"https://yazi-rs.github.io/schemas/keymap.json\"\n\n[[manager.prepend_keymap]]\non = [\"<C-a>\"]\nrun = \"help\"\ndesc = \"Just for test!\"\n\n[[manager.keymap]]\non = [\"<Esc>\"]\nexec = \"escape\"\ndesc = \"Exit visual mode, clear selected, or cancel search\"\n\n[[manager.keymap]]\non = [\"q\"]\nexec = \"quit\"\ndesc = \"Exit the process\"\n\n[[manager.keymap]]\non = [\"Q\"]\nexec = \"quit --no-cwd-file\"\ndesc = \"Exit the process without writing cwd-file\"\n\n[[manager.keymap]]\non = [\"<C-q>\"]\nexec = \"close\"\ndesc = \"Close the current tab, or quit if it is last tab\"\n\n[[manager.keymap]]\non = [\"<C-z>\"]\nexec = \"suspend\"\ndesc = \"Suspend the process\"\n\n[[manager.keymap]]\non = [\"k\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[manager.keymap]]\non = [\"j\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[manager.keymap]]\non = [\"K\"]\nexec = \"arrow -5\"\ndesc = \"Move cursor up 5 lines\"\n\n[[manager.keymap]]\non = [\"J\"]\nexec = \"arrow 5\"\ndesc = \"Move cursor down 5 lines\"\n\n[[manager.keymap]]\non = [\"<S-Up>\"]\nexec = \"arrow -5\"\ndesc = \"Move cursor up 5 lines\"\n\n[[manager.keymap]]\non = [\"<S-Down>\"]\nexec = \"arrow 5\"\ndesc = \"Move cursor down 5 lines\"\n\n[[manager.keymap]]\non = [\"<C-u>\"]\nexec = \"arrow -50%\"\ndesc = \"Move cursor up half page\"\n\n[[manager.keymap]]\non = [\"<C-d>\"]\nexec = \"arrow 50%\"\ndesc = \"Move cursor down half page\"\n\n[[manager.keymap]]\non = [\"<C-b>\"]\nexec = \"arrow -100%\"\ndesc = \"Move cursor up one page\"\n\n[[manager.keymap]]\non = [\"<C-f>\"]\nexec = \"arrow 100%\"\ndesc = \"Move cursor down one page\"\n\n[[manager.keymap]]\non = [\"<C-PageUp>\"]\nexec = \"arrow -50%\"\ndesc = \"Move cursor up half page\"\n\n[[manager.keymap]]\non = [\"<C-PageDown>\"]\nexec = \"arrow 50%\"\ndesc = \"Move cursor down half page\"\n\n[[manager.keymap]]\non = [\"<PageUp>\"]\nexec = \"arrow -100%\"\ndesc = \"Move cursor up one page\"\n\n[[manager.keymap]]\non = [\"<PageDown>\"]\nexec = \"arrow 100%\"\ndesc = \"Move cursor down one page\"\n\n[[manager.keymap]]\non = [\"h\"]\nexec = [\"leave\", \"escape --visual --select\"]\ndesc = \"Go back to the parent directory\"\n\n[[manager.keymap]]\non = [\"l\"]\nexec = [\"enter\", \"escape --visual --select\"]\ndesc = \"Enter the child directory\"\n\n[[manager.keymap]]\non = [\"H\"]\nexec = \"back\"\ndesc = \"Go back to the previous directory\"\n\n[[manager.keymap]]\non = [\"L\"]\nexec = \"forward\"\ndesc = \"Go forward to the next directory\"\n\n[[manager.keymap]]\non = [\"<A-k>\"]\nexec = \"seek -5\"\ndesc = \"Seek up 5 units in the preview\"\n\n[[manager.keymap]]\non = [\"<A-j>\"]\nexec = \"seek 5\"\ndesc = \"Seek down 5 units in the preview\"\n\n[[manager.keymap]]\non = [\"<A-PageUp>\"]\nexec = \"seek -5\"\ndesc = \"Seek up 5 units in the preview\"\n\n[[manager.keymap]]\non = [\"<A-PageDown>\"]\nexec = \"seek 5\"\ndesc = \"Seek down 5 units in the preview\"\n\n[[manager.keymap]]\non = [\"<Up>\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[manager.keymap]]\non = [\"<Down>\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[manager.keymap]]\non = [\"<Left>\"]\nexec = \"leave\"\ndesc = \"Go back to the parent directory\"\n\n[[manager.keymap]]\non = [\"<Right>\"]\nexec = \"enter\"\ndesc = \"Enter the child directory\"\n\n[[manager.keymap]]\non = [\"g\", \"g\"]\nexec = \"arrow -99999999\"\ndesc = \"Move cursor to the top\"\n\n[[manager.keymap]]\non = [\"G\"]\nexec = \"arrow 99999999\"\ndesc = \"Move cursor to the bottom\"\n\n[[manager.keymap]]\non = [\"<Space>\"]\nexec = [\"select --state=none\", \"arrow 1\"]\ndesc = \"Toggle the current selection state\"\n\n[[manager.keymap]]\non = [\"v\"]\nexec = \"visual_mode\"\ndesc = \"Enter visual mode (selection mode)\"\n\n[[manager.keymap]]\non = [\"V\"]\nexec = \"visual_mode --unset\"\ndesc = \"Enter visual mode (unset mode)\"\n\n[[manager.keymap]]\non = [\"<C-a>\"]\nexec = \"select_all --state=true\"\ndesc = \"Select all files\"\n\n[[manager.keymap]]\non = [\"<C-r>\"]\nexec = \"select_all --state=none\"\ndesc = \"Inverse selection of all files\"\n\n[[manager.keymap]]\non = [\"o\"]\nexec = \"open\"\ndesc = \"Open the selected files\"\n\n[[manager.keymap]]\non = [\"O\"]\nexec = \"open --interactive\"\ndesc = \"Open the selected files interactively\"\n\n[[manager.keymap]]\non = [\"<Enter>\"]\nexec = \"open\"\ndesc = \"Open the selected files\"\n\n[[manager.keymap]]\non = [\"<C-Enter>\"]\nexec = \"open --interactive\"\ndesc = \"Open the selected files interactively\"\n\n[[manager.keymap]]\non = [\"y\"]\nexec = [\"yank\", \"escape --visual --select\"]\ndesc = \"Copy the selected files\"\n\n[[manager.keymap]]\non = [\"Y\"]\nexec = [\"unyank\", \"escape --visual --select\"]\ndesc = \"Cancel the yank status of files\"\n\n[[manager.keymap]]\non = [\"x\"]\nexec = [\"yank --cut\", \"escape --visual --select\"]\ndesc = \"Cut the selected files\"\n\n[[manager.keymap]]\non = [\"p\"]\nexec = \"paste\"\ndesc = \"Paste the files\"\n\n[[manager.keymap]]\non = [\"P\"]\nexec = \"paste --force\"\ndesc = \"Paste the files (overwrite if the destination exists)\"\n\n[[manager.keymap]]\non = [\"-\"]\nexec = \"link\"\ndesc = \"Symlink the absolute path of files\"\n\n[[manager.keymap]]\non = [\"_\"]\nexec = \"link --relative\"\ndesc = \"Symlink the relative path of files\"\n\n[[manager.keymap]]\non = [\"d\"]\nexec = [\"remove\", \"escape --visual --select\"]\ndesc = \"Move the files to the trash\"\n\n[[manager.keymap]]\non = [\"D\"]\nexec = [\"remove --permanently\", \"escape --visual --select\"]\ndesc = \"Permanently delete the files\"\n\n[[manager.keymap]]\non = [\"a\"]\nexec = \"create\"\ndesc = \"Create a file or directory (ends with / for directories)\"\n\n[[manager.keymap]]\non = [\"r\"]\nexec = \"rename --cursor=before_ext\"\ndesc = \"Rename a file or directory\"\n\n[[manager.keymap]]\non = [\";\"]\nexec = \"shell\"\ndesc = \"Run a shell command\"\n\n[[manager.keymap]]\non = [\":\"]\nexec = \"shell --block\"\ndesc = \"Run a shell command (block the UI until the command finishes)\"\n\n[[manager.keymap]]\non = [\".\"]\nexec = \"hidden toggle\"\ndesc = \"Toggle the visibility of hidden files\"\n\n[[manager.keymap]]\non = [\"s\"]\nexec = \"search fd\"\ndesc = \"Search files by name using fd\"\n\n[[manager.keymap]]\non = [\"S\"]\nexec = \"search rg\"\ndesc = \"Search files by content using ripgrep\"\n\n[[manager.keymap]]\non = [\"<C-s>\"]\nexec = \"search none\"\ndesc = \"Cancel the ongoing search\"\n\n[[manager.keymap]]\non = [\"z\"]\nexec = \"jump zoxide\"\ndesc = \"Jump to a directory using zoxide\"\n\n[[manager.keymap]]\non = [\"Z\"]\nexec = \"jump fzf\"\ndesc = \"Jump to a directory, or reveal a file using fzf\"\n\n[[manager.keymap]]\non = [\"m\", \"s\"]\nexec = \"linemode size\"\ndesc = \"Set linemode to size\"\n\n[[manager.keymap]]\non = [\"m\", \"p\"]\nexec = \"linemode permissions\"\ndesc = \"Set linemode to permissions\"\n\n[[manager.keymap]]\non = [\"m\", \"m\"]\nexec = \"linemode mtime\"\ndesc = \"Set linemode to mtime\"\n\n[[manager.keymap]]\non = [\"m\", \"n\"]\nexec = \"linemode none\"\ndesc = \"Set linemode to none\"\n\n[[manager.keymap]]\non = [\"c\", \"c\"]\nexec = \"copy path\"\ndesc = \"Copy the absolute path\"\n\n[[manager.keymap]]\non = [\"c\", \"d\"]\nexec = \"copy dirname\"\ndesc = \"Copy the path of the parent directory\"\n\n[[manager.keymap]]\non = [\"c\", \"f\"]\nexec = \"copy filename\"\ndesc = \"Copy the name of the file\"\n\n[[manager.keymap]]\non = [\"c\", \"n\"]\nexec = \"copy name_without_ext\"\ndesc = \"Copy the name of the file without the extension\"\n\n[[manager.keymap]]\non = [\"f\"]\nexec = \"filter --smart\"\ndesc = \"Filter the files\"\n\n[[manager.keymap]]\non = [\"/\"]\nexec = \"find --smart\"\ndesc = \"Find next file\"\n\n[[manager.keymap]]\non = [\"?\"]\nexec = \"find --previous --smart\"\ndesc = \"Find previous file\"\n\n[[manager.keymap]]\non = [\"n\"]\nexec = \"find_arrow\"\ndesc = \"Go to next found file\"\n\n[[manager.keymap]]\non = [\"N\"]\nexec = \"find_arrow --previous\"\ndesc = \"Go to previous found file\"\n\n[[manager.keymap]]\non = [\",\", \"m\"]\nexec = \"sort modified --dir-first\"\ndesc = \"Sort by modified time\"\n\n[[manager.keymap]]\non = [\",\", \"M\"]\nexec = \"sort modified --reverse --dir-first\"\ndesc = \"Sort by modified time (reverse)\"\n\n[[manager.keymap]]\non = [\",\", \"c\"]\nexec = \"sort created --dir-first\"\ndesc = \"Sort by created time\"\n\n[[manager.keymap]]\non = [\",\", \"C\"]\nexec = \"sort created --reverse --dir-first\"\ndesc = \"Sort by created time (reverse)\"\n\n[[manager.keymap]]\non = [\",\", \"e\"]\nexec = \"sort extension --dir-first\"\ndesc = \"Sort by extension\"\n\n[[manager.keymap]]\non = [\",\", \"E\"]\nexec = \"sort extension --reverse --dir-first\"\ndesc = \"Sort by extension (reverse)\"\n\n[[manager.keymap]]\non = [\",\", \"a\"]\nexec = \"sort alphabetical --dir-first\"\ndesc = \"Sort alphabetically\"\n\n[[manager.keymap]]\non = [\",\", \"A\"]\nexec = \"sort alphabetical --reverse --dir-first\"\ndesc = \"Sort alphabetically (reverse)\"\n\n[[manager.keymap]]\non = [\",\", \"n\"]\nexec = \"sort natural --dir-first\"\ndesc = \"Sort naturally\"\n\n[[manager.keymap]]\non = [\",\", \"N\"]\nexec = \"sort natural --reverse --dir-first\"\ndesc = \"Sort naturally (reverse)\"\n\n[[manager.keymap]]\non = [\",\", \"s\"]\nexec = \"sort size --dir-first\"\ndesc = \"Sort by size\"\n\n[[manager.keymap]]\non = [\",\", \"S\"]\nexec = \"sort size --reverse --dir-first\"\ndesc = \"Sort by size (reverse)\"\n\n[[manager.keymap]]\non = [\"t\"]\nexec = \"tab_create --current\"\ndesc = \"Create a new tab using the current path\"\n\n[[manager.keymap]]\non = [\"1\"]\nexec = \"tab_switch 0\"\ndesc = \"Switch to the first tab\"\n\n[[manager.keymap]]\non = [\"2\"]\nexec = \"tab_switch 1\"\ndesc = \"Switch to the second tab\"\n\n[[manager.keymap]]\non = [\"3\"]\nexec = \"tab_switch 2\"\ndesc = \"Switch to the third tab\"\n\n[[manager.keymap]]\non = [\"4\"]\nexec = \"tab_switch 3\"\ndesc = \"Switch to the fourth tab\"\n\n[[manager.keymap]]\non = [\"5\"]\nexec = \"tab_switch 4\"\ndesc = \"Switch to the fifth tab\"\n\n[[manager.keymap]]\non = [\"6\"]\nexec = \"tab_switch 5\"\ndesc = \"Switch to the sixth tab\"\n\n[[manager.keymap]]\non = [\"7\"]\nexec = \"tab_switch 6\"\ndesc = \"Switch to the seventh tab\"\n\n[[manager.keymap]]\non = [\"8\"]\nexec = \"tab_switch 7\"\ndesc = \"Switch to the eighth tab\"\n\n[[manager.keymap]]\non = [\"9\"]\nexec = \"tab_switch 8\"\ndesc = \"Switch to the ninth tab\"\n\n[[manager.keymap]]\non = [\"[\"]\nexec = \"tab_switch -1 --relative\"\ndesc = \"Switch to the previous tab\"\n\n[[manager.keymap]]\non = [\"]\"]\nexec = \"tab_switch 1 --relative\"\ndesc = \"Switch to the next tab\"\n\n[[manager.keymap]]\non = [\"{\"]\nexec = \"tab_swap -1\"\ndesc = \"Swap the current tab with the previous tab\"\n\n[[manager.keymap]]\non = [\"}\"]\nexec = \"tab_swap 1\"\ndesc = \"Swap the current tab with the next tab\"\n\n[[manager.keymap]]\non = [\"w\"]\nexec = \"tasks_show\"\ndesc = \"Show the tasks manager\"\n\n[[manager.keymap]]\non = [\"g\", \"h\"]\nexec = \"cd ~\"\ndesc = \"Go to the home directory\"\n\n[[manager.keymap]]\non = [\"g\", \"c\"]\nexec = \"cd ~/.config\"\ndesc = \"Go to the config directory\"\n\n[[manager.keymap]]\non = [\"g\", \"d\"]\nexec = \"cd ~/Downloads\"\ndesc = \"Go to the downloads directory\"\n\n[[manager.keymap]]\non = [\"g\", \"t\"]\nexec = \"cd /tmp\"\ndesc = \"Go to the temporary directory\"\n\n[[manager.keymap]]\non = [\"g\", \"<Space>\"]\nexec = \"cd --interactive\"\ndesc = \"Go to a directory interactively\"\n\n[[manager.keymap]]\non = [\"~\"]\nexec = \"help\"\ndesc = \"Open help\"\n\n[[tasks.keymap]]\non = [\"<Esc>\"]\nexec = \"close\"\ndesc = \"Hide the task manager\"\n\n[[tasks.keymap]]\non = [\"<C-q>\"]\nexec = \"close\"\ndesc = \"Hide the task manager\"\n\n[[tasks.keymap]]\non = [\"w\"]\nexec = \"close\"\ndesc = \"Hide the task manager\"\n\n[[tasks.keymap]]\non = [\"k\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[tasks.keymap]]\non = [\"j\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[tasks.keymap]]\non = [\"<Up>\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[tasks.keymap]]\non = [\"<Down>\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[tasks.keymap]]\non = [\"<Enter>\"]\nexec = \"inspect\"\ndesc = \"Inspect the task\"\n\n[[tasks.keymap]]\non = [\"x\"]\nexec = \"cancel\"\ndesc = \"Cancel the task\"\n\n[[tasks.keymap]]\non = [\"~\"]\nexec = \"help\"\ndesc = \"Open help\"\n\n[[select.keymap]]\non = [\"<C-q>\"]\nexec = \"close\"\ndesc = \"Cancel selection\"\n\n[[select.keymap]]\non = [\"<Esc>\"]\nexec = \"close\"\ndesc = \"Cancel selection\"\n\n[[select.keymap]]\non = [\"<Enter>\"]\nexec = \"close --submit\"\ndesc = \"Submit the selection\"\n\n[[select.keymap]]\non = [\"k\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[select.keymap]]\non = [\"j\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[select.keymap]]\non = [\"K\"]\nexec = \"arrow -5\"\ndesc = \"Move cursor up 5 lines\"\n\n[[select.keymap]]\non = [\"J\"]\nexec = \"arrow 5\"\ndesc = \"Move cursor down 5 lines\"\n\n[[select.keymap]]\non = [\"<Up>\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[select.keymap]]\non = [\"<Down>\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[select.keymap]]\non = [\"<S-Up>\"]\nexec = \"arrow -5\"\ndesc = \"Move cursor up 5 lines\"\n\n[[select.keymap]]\non = [\"<S-Down>\"]\nexec = \"arrow 5\"\ndesc = \"Move cursor down 5 lines\"\n\n[[select.keymap]]\non = [\"~\"]\nexec = \"help\"\ndesc = \"Open help\"\n\n[[input.keymap]]\non = [\"<C-q>\"]\nexec = \"close\"\ndesc = \"Cancel input\"\n\n[[input.keymap]]\non = [\"<Enter>\"]\nexec = \"close --submit\"\ndesc = \"Submit the input\"\n\n[[input.keymap]]\non = [\"<Esc>\"]\nexec = \"escape\"\ndesc = \"Go back the normal mode, or cancel input\"\n\n[[input.keymap]]\non = [\"i\"]\nexec = \"insert\"\ndesc = \"Enter insert mode\"\n\n[[input.keymap]]\non = [\"a\"]\nexec = \"insert --append\"\ndesc = \"Enter append mode\"\n\n[[input.keymap]]\non = [\"I\"]\nexec = [\"move -999\", \"insert\"]\ndesc = \"Move to the BOL, and enter insert mode\"\n\n[[input.keymap]]\non = [\"A\"]\nexec = [\"move 999\", \"insert --append\"]\ndesc = \"Move to the EOL, and enter append mode\"\n\n[[input.keymap]]\non = [\"v\"]\nexec = \"visual\"\ndesc = \"Enter visual mode\"\n\n[[input.keymap]]\non = [\"V\"]\nexec = [\"move -999\", \"visual\", \"move 999\"]\ndesc = \"Enter visual mode and select all\"\n\n[[input.keymap]]\non = [\"h\"]\nexec = \"move -1\"\ndesc = \"Move back a character\"\n\n[[input.keymap]]\non = [\"l\"]\nexec = \"move 1\"\ndesc = \"Move forward a character\"\n\n[[input.keymap]]\non = [\"<Left>\"]\nexec = \"move -1\"\ndesc = \"Move back a character\"\n\n[[input.keymap]]\non = [\"<Right>\"]\nexec = \"move 1\"\ndesc = \"Move forward a character\"\n\n[[input.keymap]]\non = [\"<C-b>\"]\nexec = \"move -1\"\ndesc = \"Move back a character\"\n\n[[input.keymap]]\non = [\"<C-f>\"]\nexec = \"move 1\"\ndesc = \"Move forward a character\"\n\n[[input.keymap]]\non = [\"b\"]\nexec = \"backward\"\ndesc = \"Move back to the start of the current or previous word\"\n\n[[input.keymap]]\non = [\"w\"]\nexec = \"forward\"\ndesc = \"Move forward to the start of the next word\"\n\n[[input.keymap]]\non = [\"e\"]\nexec = \"forward --end-of-word\"\ndesc = \"Move forward to the end of the current or next word\"\n\n[[input.keymap]]\non = [\"<A-b>\"]\nexec = \"backward\"\ndesc = \"Move back to the start of the current or previous word\"\n\n[[input.keymap]]\non = [\"<A-f>\"]\nexec = \"forward --end-of-word\"\ndesc = \"Move forward to the end of the current or next word\"\n\n[[input.keymap]]\non = [\"0\"]\nexec = \"move -999\"\ndesc = \"Move to the BOL\"\n\n[[input.keymap]]\non = [\"$\"]\nexec = \"move 999\"\ndesc = \"Move to the EOL\"\n\n[[input.keymap]]\non = [\"<C-a>\"]\nexec = \"move -999\"\ndesc = \"Move to the BOL\"\n\n[[input.keymap]]\non = [\"<C-e>\"]\nexec = \"move 999\"\ndesc = \"Move to the EOL\"\n\n[[input.keymap]]\non = [\"<Backspace>\"]\nexec = \"backspace\"\ndesc = \"Delete the character before the cursor\"\n\n[[input.keymap]]\non = [\"<C-h>\"]\nexec = \"backspace\"\ndesc = \"Delete the character before the cursor\"\n\n[[input.keymap]]\non = [\"<C-d>\"]\nexec = \"backspace --under\"\ndesc = \"Delete the character under the cursor\"\n\n[[input.keymap]]\non = [\"<C-u>\"]\nexec = \"kill bol\"\ndesc = \"Kill backwards to the BOL\"\n\n[[input.keymap]]\non = [\"<C-k>\"]\nexec = \"kill eol\"\ndesc = \"Kill forwards to the EOL\"\n\n[[input.keymap]]\non = [\"<C-w>\"]\nexec = \"kill backward\"\ndesc = \"Kill backwards to the start of the current word\"\n\n[[input.keymap]]\non = [\"<A-d>\"]\nexec = \"kill forward\"\ndesc = \"Kill forwards to the end of the current word\"\n\n[[input.keymap]]\non = [\"d\"]\nexec = \"delete --cut\"\ndesc = \"Cut the selected characters\"\n\n[[input.keymap]]\non = [\"D\"]\nexec = [\"delete --cut\", \"move 999\"]\ndesc = \"Cut until the EOL\"\n\n[[input.keymap]]\non = [\"c\"]\nexec = \"delete --cut --insert\"\ndesc = \"Cut the selected characters, and enter insert mode\"\n\n[[input.keymap]]\non = [\"C\"]\nexec = [\"delete --cut --insert\", \"move 999\"]\ndesc = \"Cut until the EOL, and enter insert mode\"\n\n[[input.keymap]]\non = [\"x\"]\nexec = [\"delete --cut\", \"move 1 --in-operating\"]\ndesc = \"Cut the current character\"\n\n[[input.keymap]]\non = [\"y\"]\nexec = \"yank\"\ndesc = \"Copy the selected characters\"\n\n[[input.keymap]]\non = [\"p\"]\nexec = \"paste\"\ndesc = \"Paste the copied characters after the cursor\"\n\n[[input.keymap]]\non = [\"P\"]\nexec = \"paste --before\"\ndesc = \"Paste the copied characters before the cursor\"\n\n[[input.keymap]]\non = [\"u\"]\nexec = \"undo\"\ndesc = \"Undo the last operation\"\n\n[[input.keymap]]\non = [\"<C-r>\"]\nexec = \"redo\"\ndesc = \"Redo the last operation\"\n\n[[input.keymap]]\non = [\"~\"]\nexec = \"help\"\ndesc = \"Open help\"\n\n[[completion.keymap]]\non = [\"<C-q>\"]\nexec = \"close\"\ndesc = \"Cancel completion\"\n\n[[completion.keymap]]\non = [\"<Tab>\"]\nexec = \"close --submit\"\ndesc = \"Submit the completion\"\n\n[[completion.keymap]]\non = [\"<Enter>\"]\nexec = [\"close --submit\", \"close_input --submit\"]\ndesc = \"Submit the completion and input\"\n\n[[completion.keymap]]\non = [\"<A-k>\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[completion.keymap]]\non = [\"<A-j>\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[completion.keymap]]\non = [\"<Up>\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[completion.keymap]]\non = [\"<Down>\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[completion.keymap]]\non = [\"~\"]\nexec = \"help\"\ndesc = \"Open help\"\n\n[[help.keymap]]\non = [\"<Esc>\"]\nexec = \"escape\"\ndesc = \"Clear the filter, or hide the help\"\n\n[[help.keymap]]\non = [\"q\"]\nexec = \"close\"\ndesc = \"Exit the process\"\n\n[[help.keymap]]\non = [\"<C-q>\"]\nexec = \"close\"\ndesc = \"Hide the help\"\n\n[[help.keymap]]\non = [\"k\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[help.keymap]]\non = [\"j\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[help.keymap]]\non = [\"K\"]\nexec = \"arrow -5\"\ndesc = \"Move cursor up 5 lines\"\n\n[[help.keymap]]\non = [\"J\"]\nexec = \"arrow 5\"\ndesc = \"Move cursor down 5 lines\"\n\n[[help.keymap]]\non = [\"<Up>\"]\nexec = \"arrow -1\"\ndesc = \"Move cursor up\"\n\n[[help.keymap]]\non = [\"<Down>\"]\nexec = \"arrow 1\"\ndesc = \"Move cursor down\"\n\n[[help.keymap]]\non = [\"<S-Up>\"]\nexec = \"arrow -5\"\ndesc = \"Move cursor up 5 lines\"\n\n[[help.keymap]]\non = [\"<S-Down>\"]\nexec = \"arrow 5\"\ndesc = \"Move cursor down 5 lines\"\n\n[[help.keymap]]\non = [\"/\"]\nexec = \"filter\"\ndesc = \"Apply a filter for the help items\"\n"), keys: ["manager", "prepend_keymap"], span: Some(61..139) } } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fish: Job 1, 'yazi $argv' terminated by signal SIGABRT (Abort)

Expected Behavior

yazi should not crash, or at least should provide an explanation of why it crashes.

To Reproduce

Set the keymap.toml as below and run yazi in any directory.

Configuration

yazi.toml:

[manager]
ratio = [2, 4, 2]
# show_hidden = true
sort_dir_first = true

keymap.toml:

[manager]
prepend_keymap = [
    { on = [ "<C-a>" ], run = 'help', desc = "Just for test!" },
]

Anything else?

No response

sxyazi commented 6 months ago

Hi, I noticed that you are not using the latest Yazi version. run is a new attribute introduced in yazi v0.2.4. Please upgrade your yazi version to the latest.

mxmerz commented 6 months ago

Oh, I'm sorry! I had updated to the latest homebrew version but didn't realize the homebrew package wasn't up to date with the code!

sxyazi commented 6 months ago

No problem! For some reason, the latest Yazi code can't pass the Homebrew's CI, so it can't be updated, this give me a headache haha

github-actions[bot] commented 5 months ago

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.