Commit graph

43 commits

Author SHA1 Message Date
aycabta
7a7854d8c1 Some I/O in test doesn't have "position"
Just returns column 1 for ambiguous width because this I/O is not tty and can't
seek.
2020-05-12 02:53:44 +09:00
aycabta
2efb38e766 [ruby/reline] Use IO#write instead of IO#print
IO#print always adds a string of $\ automatically.

a93119c847
2020-02-14 22:47:27 +09:00
aycabta
97b583d68b [ruby/reline] Organize special keys escape sequences
41deb1a3d9
2020-02-09 02:54:41 +09:00
aycabta
06c37fa5b4 [ruby/reline] Bypass cursor down when a char is rendered at eol on Windows
A newline is automatically inserted if a character is rendered at eol on
Windows command prompt.

4bfea07e4a
2020-02-02 03:28:20 +09:00
aycabta
5d124a3b68 [ruby/reline] Support GNOME style Home/End key sequences [Bug #16510]
788f0df845
2020-01-29 15:11:59 +09:00
aycabta
f8ea2860b0 Introduce an abstracted structure about the encoding of Reline
The command prompt on Windows always uses Unicode to take input and print
output but most Reline implementation depends on Encoding.default_external.
This commit introduces an abstracted structure about the encoding of Reline.
2020-01-14 15:40:38 +09:00
aycabta
da028a4fbf Rescue EOFError
If C-d is pressed before IRB is ready, IRB crashes because EOFError occurs.
2020-01-05 22:48:39 +09:00
Yusuke Endoh
337ba56aff [ruby/reline] Degenerate the terminal size to [$LINES, $COLUMNS] if it is unknown
This is a workaround for https://github.com/ruby/irb/issues/50

5725677d1a
2019-12-31 23:32:24 +09:00
Nobuyoshi Nakada
679bc4f9cb [ruby/reline] Use IO#raw to read one byte
be17740e82
2019-12-23 02:11:22 +09:00
Nobuyoshi Nakada
efd4a11ada Support multibyte input 2019-12-22 11:46:43 +09:00
Yusuke Endoh
fa1bf8ab37 [ruby/reline] Support Ctrl+right as em_next_word, and Ctrl+left as ed_prev_word
e98ad3b486
2019-12-22 05:35:03 +09:00
Yusuke Endoh
ec1de789a9 [ruby/reline] Preserve the input buffer across cursor_pos
The old version of cursor_pos discards the input buffer, which made IRB
ignore the input immediately after IRB is invoked.

This change keeps the input before cursor_pos by using ungetc.

4a8cca331f
2019-12-22 01:57:35 +09:00
Nobuyoshi Nakada
7fd6077d98 [ruby/reline] Consider Reline::ANSI.input at prep
b111cde3c3
2019-12-22 01:57:35 +09:00
Nobuyoshi Nakada
11db4d3a3b [ruby/reline] Disable any implementation-defined special control characters
Including dsusp, lnext, and so on.

a44abe586b
2019-12-17 13:19:37 +09:00
manga_osyo
81586a4d9f Add <Home> <End> keys. 2019-11-21 00:47:36 +09:00
Nobuyoshi Nakada
cef9ebfbd3 Suppress stty error on Apple Terminal
`stty` called in `Reline::ANSI.deprep` command shows the following
error message on macOS Apple Terminal, with some settings.

```
$ LANG=C irb
irb(main):001:0>
stty: 'standard input': unable to perform all requested operations
stty: 'standard input': unable to perform all requested operations
```
2019-11-19 02:39:02 +09:00
aycabta
11ae47c266 [ruby/reline] Restore left cursor key support on Unix like OSes...
98b72af751
2019-11-15 18:07:34 +09:00
aycabta
fa7618e4c1 Implement em_set_mark and em_exchange_mark 2019-11-15 16:50:40 +09:00
aycabta
53c05a6cf4 Remove freeze 2019-10-18 02:54:20 +09:00
Nobuyoshi Nakada
ae83dbe28d Get rid of IO.select to fix multiline paste 2019-09-26 00:26:33 +09:00
aycabta
b443bdbdb9 Use short wait for select(2)
It is one of the reasons why paste to IRB is slow.
2019-09-23 17:33:25 +09:00
aycabta
934507472c Retrieve key-buffer that was supposed to lose 2019-09-23 17:27:01 +09:00
Nobuyoshi Nakada
68ffb679d4 Undefine DSUSP key
Enable `Ctrl+Y`, which is bound with it by default on BSD-like
systems, for editing.
2019-09-17 15:16:12 +09:00
aycabta
83ef23bd75 Revert "Use IO#getch to read one char in raw mode"
This reverts commit 805b0a4811.
2019-09-14 00:11:01 +09:00
aycabta
e8fff0ec9c Revert "Use IO#getbyte"
This reverts commit 685f12bbca.
2019-09-14 00:10:45 +09:00
aycabta
06bbacc086 Revert "Support multibyte input"
This reverts commit 6d9e54816f.
2019-09-14 00:10:34 +09:00
Nobuyoshi Nakada
6d9e54816f Support multibyte input 2019-09-10 00:56:31 +09:00
Nobuyoshi Nakada
685f12bbca Use IO#getbyte 2019-09-10 00:56:31 +09:00
Nobuyoshi Nakada
805b0a4811 Use IO#getch to read one char in raw mode 2019-09-10 00:56:31 +09:00
aycabta
0f405541bf Support SIGWINCH 2019-08-29 14:37:19 +09:00
Nobuyoshi Nakada
fc7b4c7018
Simplify matching 2019-06-04 00:33:56 +09:00
aycabta
7df65ef676 Use inputrc data for keystroke setting 2019-06-01 09:06:27 +09:00
Nobuyoshi Nakada
552c42f51f
Seprate raw keystroke config for each platforms 2019-06-01 00:41:17 +09:00
aycabta
eb4e774711 Support Meta key in Reline 2019-05-24 23:38:40 +09:00
aycabta
16917cc3cb Add Reline.test_mode to use with special I/O 2019-05-18 12:48:27 +09:00
aycabta
b5a3ec7f18 Remove useless use of a variable in Reline::ANSI 2019-05-14 17:15:49 +09:00
aycabta
9cb821b024 Implement Reline.input= and Reline.output= 2019-05-13 02:14:48 +09:00
aycabta
0f45bd0584 Split namespace of env-dependent I/O classes 2019-05-13 00:22:27 +09:00
aycabta
17350c7e55 Add Reline as a fallback library for Readline
* lib/reine.rb, lib/reline/*: Reline is a readline stdlib compatible
  library.
* lib/readline.rb: Readline uses a fallback to Reline when ext/readline
  doesn't exist.
* tool/sync_default_gems.rb: add ruby/reline as a default gem.
* appveyor.yml: add "set RELINE_TEST_ENCODING=Windows-31J" for test suit
  of Reline, and add "--exclude readline" to "nmake test-all" on Visual
  Studio builds because of strange behavior.
* spec/ruby/library/readline/spec_helper.rb: skip Reline as with
  RbReadline.
2019-04-30 11:44:20 +09:00
Nobuyoshi Nakada
f4f66bd11c
Revert "IRB is improved with Reline and RDoc, take 2"
Accidentally merged when 89271d4a37
"Adjusted indents".
2019-04-23 21:55:29 +09:00
aycabta
f2cd4f4cd0
IRB is improved with Reline and RDoc, take 2 2019-04-23 20:08:02 +09:00
aycabta
51cec00953 Revert "IRB is improved with Reline and RDoc"
This reverts commit 7f273ac6d0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21 09:13:49 +00:00
aycabta
7f273ac6d0 IRB is improved with Reline and RDoc
Reline is a readline stdlib compatible library. It also supports
multiline input. IRB is improved with Reline and supports multiline.
Besides, supports showing documents when completed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20 08:51:20 +00:00