Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

readline: add support for ctrl+w and ctrl+u signals #18921

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

indexxd
Copy link
Contributor

@indexxd indexxd commented Jul 20, 2023

Add support for regular terminal signals ctrl+w (deletes word back, same as ctrl+backspace behavior) and ctrl+u (deletes entire line) to the readline module.
Currently, these aren't supported but they can be found in other languages (I tried with python and nodejs).

馃 Generated by Copilot at 24d3718

This pull request enhances the Readline module for Unix systems by adding new actions for deleting the word or the line before the cursor. It modifies the vlib/readline/readline_nix.c.v file to handle the control characters and perform the deletion.

馃 Generated by Copilot at 24d3718

  • Add support for deleting word or line before cursor in readline (link, link, link, link)
  • Define new Action enum values for delete_word_left and delete_line (link)
  • Handle CTRL + U and CTRL + W key combinations in analyse_control method (link)
  • Implement delete_word_left and delete_line methods in Readline struct (link)
  • Execute the new actions in read_line method (link)
  • Remove unused and incomplete code for handling [ character in readline (link)
    • Delete commented-out block of code in analyse_char method (link)

@indexxd indexxd changed the title readline: add support for ctlr+w and ctrl+u signals readline: add support for ctrl+w and ctrl+u signals Jul 20, 2023
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 96ff3ce into vlang:master Jul 21, 2023
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants