Skip to content

Commit 7c97122

Browse files
authored
Fix: Add support for forward_char as a keyboard shortcut (ipython#15003)
The `forward_char` command is used to move the cursor forward by one character in the IPython terminal. However, when trying to create a keyboard shortcut for it (e.g., binding it to `Alt + l`), the following error was raised: ``` ValueError: prompt_toolkit:named_commands.forward_char is not a known shortcut command. ``` This happened because the `forward_char` command was not registered in the system. Specifically, the registration line was missing in `IPython/terminal/shortcuts/__init__.py`. **Fix:** Added the missing registration line for `forward_char`. Now it can be used as a keyboard shortcut without issues. **Impact:** Users can now bind custom key combinations to `forward_char` without encountering errors.
2 parents cc81ca1 + 521e985 commit 7c97122

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

IPython/terminal/shortcuts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ def win_paste(event):
631631
nc.beginning_of_buffer,
632632
nc.end_of_buffer,
633633
nc.end_of_line,
634+
nc.forward_char,
634635
nc.forward_word,
635636
nc.unix_line_discard,
636637
]

0 commit comments

Comments
 (0)