New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$stdout window size is [0,0] when using pry #37
Comments
Yep, I've also seen the pry hooks error, but didn't have time to look into it. Any suggestions how to fix it? |
Sorry, I'm just starting out with emacs/elisp , so no suggestions off the top my head :) |
This seems to help: diff --git a/inf-ruby.el b/inf-ruby.el
index e6b55be..61cea16 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -229,8 +229,17 @@ The following commands are available:
(when (eq system-type 'windows-nt)
(setq comint-process-echoes t))
(compilation-shell-minor-mode t)
+ (inf-ruby-set-window-size)
+ (add-hook 'window-configuration-change-hook 'inf-ruby-set-window-size nil t)
(run-hooks 'inf-ruby-mode-hook))
+(defun inf-ruby-set-window-size ()
+ (let ((proc (get-buffer-process (current-buffer))))
+ (when proc
+ (set-process-window-size
+ proc (window-text-height) (1- (window-body-width))))))
+
(defun inf-ruby-output-filter (output)
"Check if the current prompt is a top-level prompt."
(unless (zerop (length output)) Although I do wonder if that's something Pry should handle itself. It's not like it ends up using the returned values in any meaningful way, AFAICS. |
I've reverted the workaround, but see the update in the |
Ya, I finally wound up turning off pager too. It's shame that Pry just On Wed, Jul 30, 2014 at 10:02 PM, Dmitry Gutov notifications@github.com
|
When I enter
ls -l
into theinf-ruby
buffer I get back aZeroDivisonError
coming from line 210 inpager.rb
(pry)I tried entering
$stdout.winsize
which returned[0,0]
I can set the window size manually with
$stdout.winsize=
and that fixes the error but this has to be entered each session.Pry works normally in the gnome terminal.
Pry 0.10.0
Ruby 1.9.3
Emacs 24.3.1 (GTK)
Linux Mint 17
The text was updated successfully, but these errors were encountered: