![]() Of stuff under the hood, including configuring IRB quite heavily by default. But Tekin, I already have a command history in my Ruby console sessions and I haven’t done anything! Incidentally, this command history search will also work in your standard Or hit CTRL-c to exit the search and you’ll be Once you’ve found the command you’re after, hit return and Right hit CTRL-r again to see the next matching result until you find what Portion of the command you’re looking for. You can also search back through the history by hitting CTRL-r and typing a You run an IRB session or a Rails console, IRB will record the commands you runĪnd make them available to you in current and future sessions. Where 1000 is the number of commands you’d like IRB to remember. irbrc file in your home directory: # ~/.irbrc To enable the history for your IRB sessions (and by extension your Rails console Keep a history of your commands and let you scroll back through and re-run them. Our trusty friend the IRB console has the exact same feature, meaning it will Update: As of Ruby 2.7 IRB history is enabled by default so the following onlyĪpplies if you are running older versions of Ruby ![]() In your IRB and Rails console sessions? Enable your IRB History But did you know you can get the same behaviour Recent commands, which is great when you want to re-run long or complicatedĬommands from previous sessions. Up and down arrow keys in a terminal window and you can scroll through your most ![]() That by default these shells keeps a history of the commands you’ve run. If you spend any time in a terminal, whether bash or zsh, you’ll probably know Access your command history in IRB and Rails console sessions | .uk .ukĪccess your command history in IRB and Rails console sessions November 29, 2019 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |