ruby / ruby/reline

Reline doesn't respect EOF from the terminal

Open
#501 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
311
Forks
99
Avg merge
6d 4h
Merged PRs (30d)
1

Description

Description

When the terminal uses a different control character for EOF, it's not respected by reline.

By comparison with readline:

$ stty eof ^K # stty eof ^D to restore
$ ruby -rreadline -e Readline.readline
a^A^D^D^K

I type a, then ^A to go at the beginning of the line, then ^D to remove the a, the second ^D doesn't do anything, but ^K sends the end-of-file and ends the process.

$ stty eof ^K # stty eof ^D to restore
$ ruby -rreadline -e Readline.readline
a^A^K^K

I type a, then ^A to go at the beginning of the line, then ^K removes until the end of the line (kill-line), the second ^K sends the end-of-file and ends the process.


With reline:

$ stty eof ^K # stty eof ^D to restore
$ ruby -rreline -e Reline.readline
a^A^D^D

I type a, then ^A to go at the beginning of the line, then ^D to remove the a, the second ^D sends the end-of-file and ends the process.

$ stty eof ^K # stty eof ^D to restore
$ ruby -rreline -e Reline.readline
a^A^K^K^D

I type a, then ^A to go at the beginning of the line, then ^K removes until the end of the line (kill-line), the second ^K doesn't do anything, but ^D sends the end-of-file and ends the process.

Terminal Emulator

Terminal.app on macOS 13.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the terminal behavior with stty eof ^K and Reline.readline, then trace how Reline.readline handles control characters and EOF. Compare the observed behavior with the readline examples in the issue. Done means the configured terminal EOF character ends the process while the normal delete and kill-line controls retain their expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.