ruby / irb

interactive Ruby
BSD 2-Clause "Simplified" License
373 stars 114 forks source link

Can't launch IRB in TTY, no way to kill/sigstop #296

Open Souravgoswami opened 2 years ago

Souravgoswami commented 2 years ago

Description

Expected Behaviour: Launch IRB in TTY.

Actual Behaviour: Can't seem to launch IRB in TTY, CTRL + C, CTRL + Z, or CTRL + \ won't work. Needed to change terminal and SIGKILL.

Result of irb_info

Sorry but if I can't launch IRB, how can I paste the command? Version:

irb 1.3.5 (2021-04-03) Ruby: 2.7.3 Ruby Host OS: DragonflyBSD 6

Terminal Emulator

Default TTY 1 - 7 (No GUI installed on system)

Setting Files

None, first basic install.

Edit

Ok, so I can ssh to my Linux system, and run IRB. irb_info gives:

Ruby version: 2.7.3
IRB version: irb 1.3.5 (2021-04-03)
InputMethod: ReidlineInputMethod with Reline 0.2.7
RUBY_PLATFORM: x86_64-dragonfly6
Souravgoswami commented 2 years ago

Well, if I put --nocolorize, it still doesn't work. If I put --nomultiline it works.

mrdev023 commented 2 years ago

Same

elfham commented 2 years ago

I was also able to reproduce the problem on FreeBSD 13.0. (Ruby 2.7.4, irb 1.3.7 (2021-08-12), Reline 0.2.7, LANG=C.UTF-8)

It seems to be stuck here:

According to the following article, FreeBSD console does not respond to escape sequence of the cursor position.

for example, by remote terminal:

$ bash
[admin@freebsd ~]$ printf '\033[6n'; sleep 1; echo
^[[2;1R
[admin@freebsd ~]$ 1R

by FreeBSD console:

$ bash
[admin@freebsd ~]$ printf '\033[6n'; sleep 1; echo

[admin@freebsd ~]$ 

In these situation, it seems that we have to determine ambiguous width and cursor position in some other way.