We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfd0b91 commit b140bfcCopy full SHA for b140bfc
1 file changed
lib/irb/pager.rb
@@ -42,6 +42,14 @@ def page(retain_content: false)
42
# SIGTERM not supported (windows)
43
Process.kill("KILL", pid)
44
end
45
+
46
+ begin
47
+ # Wait for the pager process to terminate.
48
+ # Reading next input from Reline before the pager process is fully terminated
49
+ # may cause issues like raw/cooked mode not being controlled properly.
50
+ Process.waitpid(pid) if pid
51
+ rescue Errno::ECHILD, Errno::ESRCH
52
+ end
53
rescue Errno::ESRCH
54
# Pager process already terminated
55
0 commit comments