Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
bc7ddc0
Initial commit
BurdetteLamar Jul 15, 2025
636cda8
More on conditional directives
BurdetteLamar Jul 16, 2025
9bb4788
More on conditional directives
BurdetteLamar Jul 16, 2025
ada8308
More on inclusion directive
BurdetteLamar Jul 16, 2025
02d6905
Change notations: Ctrl => C; Alt => M
BurdetteLamar Jul 16, 2025
ca7b290
Add section Notations
BurdetteLamar Jul 16, 2025
532c748
More on keys
BurdetteLamar Jul 16, 2025
a1ee3c5
More on kill/yank
BurdetteLamar Jul 16, 2025
c70ddf1
More on basics
BurdetteLamar Jul 16, 2025
5b46024
Add (empty) sections Macros and Auto-Completion
BurdetteLamar Jul 16, 2025
f0dac64
Tweaks to For Users intro
BurdetteLamar Jul 17, 2025
02119f6
Tweaks to kill/yank in For Users
BurdetteLamar Jul 17, 2025
9d21af3
Remove section Macros
BurdetteLamar Jul 18, 2025
8f8c896
More introduction
BurdetteLamar Jul 19, 2025
20912a8
History searching
BurdetteLamar Jul 19, 2025
503b6ea
Change to reference-style links
BurdetteLamar Jul 20, 2025
7695f01
Adding Quantifiers
BurdetteLamar Jul 20, 2025
06660ba
Update TODOs
BurdetteLamar Jul 20, 2025
8296030
Added Command Completion
BurdetteLamar Jul 20, 2025
5eee0e0
Reorder sections in Initialization File
BurdetteLamar Jul 20, 2025
339548c
Key bindings
BurdetteLamar Jul 21, 2025
50fb348
More on bindings
BurdetteLamar Jul 22, 2025
42ca88d
More on bindings
BurdetteLamar Jul 22, 2025
42014fd
More on bindings
BurdetteLamar Jul 22, 2025
ffb2a85
More
BurdetteLamar Aug 9, 2025
a0fd2e5
Reference maker
BurdetteLamar Oct 3, 2025
8431f88
Reference maker
BurdetteLamar Oct 3, 2025
d29b8a9
Reference maker
BurdetteLamar Oct 3, 2025
022031e
Reference maker
BurdetteLamar Oct 3, 2025
4e4024d
Reference maker
BurdetteLamar Oct 3, 2025
fd68f2f
Reference maker
BurdetteLamar Oct 3, 2025
1083cdc
Reference maker
BurdetteLamar Oct 6, 2025
afa8f3a
Reference maker
BurdetteLamar Oct 7, 2025
4f072e7
Reference maker
BurdetteLamar Oct 7, 2025
71c0eda
Reference maker
BurdetteLamar Oct 7, 2025
9e5f2a7
Reference maker
BurdetteLamar Oct 7, 2025
76d1b4f
Reference maker
BurdetteLamar Oct 7, 2025
587fdde
Reference maker
BurdetteLamar Oct 8, 2025
7761460
Reference maker
BurdetteLamar Oct 8, 2025
d5de13c
Reference maker
BurdetteLamar Oct 8, 2025
f5c827c
Reference maker
BurdetteLamar Oct 8, 2025
7ffdd35
Reference maker
BurdetteLamar Oct 8, 2025
c8a398b
Reference maker
BurdetteLamar Oct 8, 2025
4ff3e0d
Reference maker
BurdetteLamar Oct 8, 2025
f5acf0c
Reference maker
BurdetteLamar Oct 9, 2025
2f78056
More on For Users
BurdetteLamar Oct 10, 2025
895101f
More on For Users
BurdetteLamar Oct 10, 2025
1aaccaf
More on For Users
BurdetteLamar Oct 11, 2025
e536890
More on For Users
BurdetteLamar Oct 12, 2025
9c5fc8e
More on For Users
BurdetteLamar Oct 12, 2025
328e1c9
More on For Users
BurdetteLamar Oct 12, 2025
ceded48
More on For Users
BurdetteLamar Oct 12, 2025
a502d90
More on For Users
BurdetteLamar Oct 14, 2025
70ce532
More on For User
BurdetteLamar Oct 14, 2025
8968e87
More on For User
BurdetteLamar Oct 14, 2025
aa42b7d
More on For Users
BurdetteLamar Oct 14, 2025
7677cbe
More on For Users
BurdetteLamar Oct 14, 2025
eb6f367
More on For Users
BurdetteLamar Oct 15, 2025
b4b242a
More on For Users
BurdetteLamar Oct 15, 2025
e86285c
More on For Users
BurdetteLamar Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 36 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,60 @@
[![Gem Version](https://badge.fury.io/rb/reline.svg)](https://badge.fury.io/rb/reline)
[![CI](https://github.com/ruby/reline/actions/workflows/reline.yml/badge.svg)](https://github.com/ruby/reline/actions/workflows/reline.yml)

This is a screen capture of *IRB improved by Reline*.

![IRB improved by Reline](https://raw.githubusercontent.com/wiki/ruby/reline/images/irb_improved_by_reline.gif)

# Reline

Reline is compatible with the API of Ruby's stdlib 'readline', GNU Readline and Editline by pure Ruby implementation.

## Usage

### Single line editing mode

It's compatible with the readline standard library.

See [the document of readline stdlib](https://ruby-doc.org/stdlib/exts/readline/Readline.html) or [bin/example](https://github.com/ruby/reline/blob/master/bin/example).
Module Reline is the Ruby library that supports:

### Multi-line editing mode
- Editing text on the command line:

```ruby
require "reline"
- Use Left-Arrow and Right-Arrow keys (`←` and `→`) to move the cursor within the text you've typed.
- Use Delete and Backspace keys to remove characters from the typed text.
- Type to insert text at the cursor.
- Use Tab key to invoke auto-completion.

prompt = 'prompt> '
use_history = true
- Reviewing and re-using command-line history:

begin
while true
text = Reline.readmultiline(prompt, use_history) do |multiline_input|
# Accept the input until `end` is entered
multiline_input.split.last == "end"
end
- Use Up-Arrow and Down-Arrow keys (`↑` and `↓`) to scroll among previously typed commands.
- Use history index numbers to select and invoke commands from history.

puts 'You entered:'
puts text
end
# If you want to exit, type Ctrl-C
rescue Interrupt
puts '^C'
exit 0
end
```
## Your Reline

```bash
$ ruby example.rb
prompt> aaa
prompt> bbb
prompt> end
You entered:
aaa
bbb
end
```
If you are the _user_ of a console application that uses Reline
(such as [IRB](https://ruby.github.io/irb/index.html)),
see [For Users](for_users.md);
see also [Reline in Action](rdoc-ref:README.md@Reline+in+Action) below.

See also: [test/reline/yamatanooroti/multiline_repl](https://github.com/ruby/reline/blob/master/test/reline/yamatanooroti/multiline_repl)
If you are the _developer_ of a console application that uses (or will use) Reline,
see [For Developers](for_developers.md).

## Documentation
If you want to _contribute_ to Reline code or documentation
(enhancements or bug fixes),
see [For Contributors](for_contributors.md).

### Reline::Face
If you want to _report_ a bug in Reline code or documentation,
see [Reporting Bugs](reporting_bugs.md).

You can modify the text color and text decorations in your terminal emulator.
See [doc/reline/face.md](./doc/reline/face.md)
## Reline in Action

## Contributing
Below is a screen capture of a brief session
in [IRB](https://ruby.github.io/irb/index.html) (Interactive Ruby),
which uses Reline:

Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/reline.
- The dark gray area of the window at the upper-right shows the keys that are being typed.
- The main part of the window shows the result of the typing.

### Run tests

> **Note**
> Please make sure you have `libvterm` installed for `yamatanooroti` tests (integration tests).

If you use Homebrew, you can install it by running `brew install libvterm`.

```bash
WITH_VTERM=1 bundle install
WITH_VTERM=1 bundle exec rake test test_yamatanooroti
```

## Releasing

```bash
rake release
gh release create vX.Y.Z --generate-notes
```
![IRB improved by Reline](https://raw.githubusercontent.com/wiki/ruby/reline/images/irb_improved_by_reline.gif)

## License

The gem is available as open source under the terms of the [Ruby License](https://www.ruby-lang.org/en/about/license.txt).

## Acknowledgments for [rb-readline](https://github.com/ConnorAtherton/rb-readline)
## Acknowledgment

In developing Reline, we have used some of the rb-readline implementation, so this library includes [copyright notice, list of conditions and the disclaimer](license_of_rb-readline) under the 3-Clause BSD License. Reline would never have been developed without rb-readline. Thank you for the tremendous accomplishments.
In developing Reline, we have used some of the implementation
of [rb-readline](https://github.com/ConnorAtherton/rb-readline),
so this library includes
[copyright notice, list of conditions and the disclaimer](../license_of_rb-readline)
under the 3-Clause BSD License.
Reline would never have been developed without rb-readline.
Thank you for the tremendous accomplishments.
2 changes: 2 additions & 0 deletions doc/for_contributors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# For Contributors

92 changes: 92 additions & 0 deletions doc/for_developers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# For Developers

This page is for the developer who wants to use `reline`
in a console application.

Other pages:

- Page [README](README.md) gives a general description
of `reline` and what it does.
- Page [For Users](for_users.md)
is for the user of a console application
that uses module `reline`.


The first thing to know about `reline` is that you make it available in your program with:

```
require 'reline'
```

## Usage

### Single line editing mode

It's compatible with the readline standard library.

See [the document of readline stdlib](https://ruby-doc.org/stdlib/exts/readline/Readline.html) or [bin/example](https://github.com/ruby/reline/blob/master/bin/example).

### Multi-line editing mode

```ruby
require "reline"

prompt = 'prompt> '
use_history = true

begin
while true
text = Reline.readmultiline(prompt, use_history) do |multiline_input|
# Accept the input until `end` is entered
multiline_input.split.last == "end"
end

puts 'You entered:'
puts text
end
# If you want to exit, type Ctrl-C
rescue Interrupt
puts '^C'
exit 0
end
```

```bash
$ ruby example.rb
prompt> aaa
prompt> bbb
prompt> end
You entered:
aaa
bbb
end
```

See also: [test/reline/yamatanooroti/multiline_repl](https://github.com/ruby/reline/blob/master/test/reline/yamatanooroti/multiline_repl)

## Documentation

### Reline::Face

You can modify the text color and text decorations in your terminal emulator.
See [doc/reline/face.md](./doc/reline/face.md)

### Run tests

> **Note**
> Please make sure you have `libvterm` installed for `yamatanooroti` tests (integration tests).

If you use Homebrew, you can install it by running `brew install libvterm`.

```bash
WITH_VTERM=1 bundle install
WITH_VTERM=1 bundle exec rake test test_yamatanooroti
```

## Releasing

```bash
rake release
gh release create vX.Y.Z --generate-notes
```

Loading