-
Notifications
You must be signed in to change notification settings - Fork 16
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
Text Wrapping issues #30
Comments
Thanks for the bug report! I can't reproduce this using safer_rails_console 0.4.0 + Rails 6.0.3.3 + Ruby 2.6.5 + iTerm2 3.4.0beta8 + bash though: Can you narrow the bug down to a particular version of the various libraries/applications in play here? Perhaps this gem's prompt format string is conflicting with something in your Rails application name or shell configuration? |
@jturkel : Thank you for responding! We're on 0.3.0 of safer_rails_console, and when I removed the version limiter, it still got 0.3.0. How do I get 0.4.0? Is that a beta branch or something of that nature? We're still in Rails 4.7 and Ruby 2.4.9. I'm using iTerm 3.3.12 (the latest non-beta version) + zsh (because Mac switched to that recently). That's an interesting idea, how would I tell if that were the case? I did discover something interesting just yesterday. iTerm had my "new window columns" set to 80 by default. I usually ignore that because I change the window size to suit my needs in the moment, so what it starts out as is usually irrelevant. But, the wrapping so early got me to thinking about that. When I set it to the maximum (~1200), this issue wasn't nearly as pronounced, because it didn't cut off my letters quite so early. So, perhaps there's some kind of issue where safer_rails_console doesn't listen to changes in window size? |
safer_rails_console really just configures the IRB prompt using the customizations in this file that set its document prompt configuration options. All of the lower level details about how to render lines are handled directly by IRB. My recommendation for debugging this it to copy the customizations from |
@jturkel : Fascinating. Especially curious since disabling safer_rails_console does resolve these issues entirely. If I can scrape together some extra bandwidth, I'll try some of those troubleshooting strategies. Thank you for the insight! |
@jturkel : One of my colleagues figured out some code to run after the console has started up to resolve the wrapping issues:
This seems to disable the colorization of the prompt, but that's a minor price to pay for proper wrapping. I tried a couple of different strategies to force this to automatically happen each time the console was fired up. The first was to add a
However, I saw the following error when I attempted to start my rails console:
You can see that the Next, I tried to create and edit a
That was better, but I still get an error when I start up the console, and the wrapping is still broken:
Here, we can see that the IRB object is there, and I did some other testing to confirm that the I looked into the file you suggested, and it seems like the problem may lie in the
By "worked" I mean that the wrapping worked, but the colors did not. So, I think the real solution might be more subtle ... |
I think there's some plugin we're running in iTerm2 related to themes. Could we commit something like this change to the project? (I couldn't just add the [ to the string as ruby kept truncating the 's) |
I'm using the most recent version (0.3.0) of safer_rails_console, and Iterm2. When I use the terminal normally, it wraps text to the next line when I get to the edge of the window. However, when I start up the Rails console, it both wraps too early (there is still plenty of white space before the edge of the window), and starts overwriting the current line, instead of going to the next line. If I disable the safer_rails_console gem, it wraps properly.
Here is what it looks like with safer_rails_console:
Here is what it looks like without safer_rails_console:
The text was updated successfully, but these errors were encountered: