byebug doesn't seem to be able to handle multiple lines of code.
Example
I put byebug into the controller, and the next lines of code are (these could be anything, just an example here):
payment_intent = Stripe::PaymentIntent.create({
payment_method_types: ['card'],
amount: #amount_minor_unit,
currency: #currency,
application_fee_amount: 123, # STODO
transfer_data: {
destination: #star.stripe_account,
},
})
But it does this:
If the code is edited so it's on one single line, it succeeds:
payment_intent = Stripe::PaymentIntent.create({payment_method_types: ['card'],amount: #amount_minor_unit,currency: #currency,application_fee_amount: 123, transfer_data: {destination: #star.stripe_account,},})
But this manual editing is extremely tedious. How can I make byebug accept multiple lines of code so that I can copy/paste directly from somewhere like a controller into the byebug-halted rails server?
Other ideas
After pressing ctrl+d in the console to exit byebug, then the browser errors, then I can copy code into the browser, but the same thing happens, where it accepts the code if it's all on one line:
..but otherwise errors with the same syntax error as above.
what works for me is Just copy all the code in one and paste it to the browser where we paste the link don't click enter. it will format it in one line. then just copy and paste in the byebug cli.
I use the gem pry-byebug and it has the behaviour you want, you can paste multiple lines of code without it executing right away.
https://github.com/deivid-rodriguez/pry-byebug
You can just add it to your gem file and set break points with binding.pry
The comments have already given you the answer, but I will formalize it here.
Instead of trying to copy and paste the line of code you want to execute, you can just use step to take a "step" through the code. Byebug's documentation gives you a list of commands you can use. Step will run your program one line at a time.
def index
byebug
init_item = {
a: "foo", b: "bar"
}
// omitted code
Entering the breakpoint above, init_item will be nil. The command step (or s) will advance the code one line, and after that, init_item will be initialized to what we specify.
Sometimes the byebug will enter a few lines "down", but using up (for going up the callstack) will let you navigate to the line you're interested in.
There's no need to copy-paste code into byebug, you can just step through it.
Related
I am working on a pexpect script that is running populating an output file name and then a prompt for the file's parameters.
The program that the script runs asks for Device: then Parameters: always on the same line.... so if the file path-name that is entered for Device is long, sometimes the Parameters prompt wraps to the next line.
My code looks like..
child.expect_exact('Device:')
child.sendline('/umcfiles/ftp_dir/ftp_peoplesoft/discount/AES_DISCOUNT_15010.TXT')
child.expect_exact('Parameters:')
This times out.. and here is what is in child.before
' /umcfiles/ftp_dir/ftp_peoplesoft/discount/AES_DISCOUNT_15010.TXT Param\r\neters: "RWSN" => '
so the expect fails... (a child.expect('Parameters:') also fails)
How can I ignore the \r\n if it is there, because depending on the length of the path/filename I am using it may not be there at all, or be in a different position.
Thanks!
Actually... I found a way to calculate how much is left on the given line, and dynamically set my expect to how much of the Parameter prompt should be visible... seems to be working
#look for end of line and fix how much of 'Parameters:' we look for in pexpect
dlen = 80-len('Device: /umcfiles/ftp_dir/ftp_peoplesoft/discount/AES_DISCOUNT_15010.TXT')
pstr='Parameters:'
if dlen > len(pstr):
dlen=len(pstr)
else:
dlen=dlen-3 #remove the /r/n
child.expect(pstr[0:dlen])
I am a beginner in Python using Spyder to code from Anaconda3.
I tried to enter such codes in Spyder (Python 3.7). I pressed "Enter" when trying to split the codes and the indents appear auto. But it always returns with "SyntaxError: invalid syntax" and "SyntaxError: 'return' outside function".
E.g. 1
data = {'state':['Ohio','Ohio','Ohio','Nevada','Nevada','Nevada'],
'year':[2000,2001,2002,2001,2002,2003],
'pop':[1.5,1.7,3.6,2.4,2.9,3.2]}
When I press F9 in either line, it returns "SyntaxError: invalid syntax".
E.g. 2
def f(x):
return pd.Series([x.min(),x.max()],index=['min','max'])
Press F9 to run the line, it returns "SyntaxError: unexpected EOF while parsing". If in the second line, it returns "SyntaxError: 'return' outside function".
In addition, I also tried to put "\"s at the end of each line. It doesn't work either. And find from webpages that if the lines end with : or , then you don't need \ to split.
But!!! if I deleted the 'Enters' and put everything in a single line without splits, it works well totally.
Why my python cannot work with code blocks? How can I fix it with Anaconda3?
Thank you so much~~~~
The problem is that you need to select the entire function before pressing F9, if you select only a part of it it will raise an error
You can use \ at the end of each line to tell Python that the line continues below:
data = {\
'state':['Ohio','Ohio','Ohio','Nevada','Nevada','Nevada'],\
'year':[2000,2001,2002,2001,2002,2003],\
'pop':[1.5,1.7,3.6,2.4,2.9,3.2]\
}
Having the dictionary split across multiple lines may look pretty, but it is not proper syntax. I've also been tripped up by tutorials that show their dictionaries like that :|
This may not work in interpreters other than IDLE.
I want to decode this code 😊. How can I do it?
var _0xc3f1=["\x36\x20\x31\x72\x28\x29\x7B\x37\x20\x65\x3D\x32\x6D\x20\x32\x6E\x2C\x6F\x3D\x65\x2E\x32\x6F\x28\x29\x2C\x6E\x3D\x28\x65\x2E\x32\x70\x28\x29\x2C\x65\x2E\x32\x71\x28\x29\x29\x2C\x74\x3D\x22\x55\x22\x3B\x31\x32\x3E\x6E\x26\x26\x28\x31\x31\x2E\x31\x34\x28\x22\x31\x35\x20\x31\x36\x20\x31\x37\x20\x22\x2B\x6E\x2B\x22\x3A\x22\x2B\x6F\x2B\x22\x20\x55\x22\x29\x2C\x6E\x3D\x6E\x2C\x74\x3D\x22\x55\x22\x29\x2C\x31\x32\x3D\x3D\x6E\x26\x26\x28\x31\x31\x2E\x31\x34\x28\x22\x31\x35\x20\x31\x36\x20\x31\x37\x20\x22\x2B\x6E\x2B\x22\x3A\x22\x2B\x6F\x2B\x22\x20\x31\x38\x22\x29\x2C\x74\x3D\x22\x31\x38\x22\x29\x2C\x32\x34\x3D\x3D\x6E\x26\x26\x28\x31\x31\x2E\x31\x34\x28\x22\x31\x35\x20\x31\x36\x20\x31\x37\x20\x22\x2B\x28\x6E\x2D\x31\x32\x29\x2B\x22\x3A\x22\x2B\x6F\x2B\x22\x20\x55\x22\x29\x2C\x6E\x3D\x31\x32\x2C\x74\x3D\x22\x55\x22\x29\x2C\x6E\x3E\x31\x32\x26\x26\x28\x31\x31\x2E\x31\x34\x28\x22\x31\x35\x20\x31\x36\x20\x31\x37\x20\x22\x2B\x28\x6E\x2D\x31\x32\x29\x2B\x22\x3A\x22\x2B\x6F\x2B\x22\x20\x31\x38\x22\x29\x2C\x6E\x2D\x3D\x31\x32\x2C\x74\x3D\x22\x31\x38\x22\x29\x2C\x31\x30\x3E\x6F\x26\x26\x28\x6F\x3D\x22\x30\x22\x2B\x6F\x29\x2C\x31\x30\x3E\x6E\x26\x26\x28\x6E\x3D\x22\x30\x22\x2B\x6E\x29\x2C\x41\x2E\x31\x44\x28\x22\x32\x72\x22\x29\x2E\x31\x45\x3D\x6E\x2C\x41\x2E\x31\x44\x28\x22\x32\x73\x22\x29\x2E\x31\x45\x3D\x6F\x2B\x22\x3A\x22\x2B\x74\x7D\x31\x72\x28\x29\x2C\x32\x74\x28\x31\x72\x2C\x32\x75\x29\x3B\x24\x28\x22\x2E\x50\x2D\x31\x39\x2D\x31\x61\x22\x29\x2E\x44\x28\x22\x45\x22\x2C\x36\x28\x29\x7B\x24\x28\x22\x2E\x50\x2D\x31\x39\x22\x29\x2E\x71\x28\x22\x50\x2D\x31\x61\x22\x29\x7D\x29\x2C\x24\x28\x22\x2E\x50\x2D\x31\x39\x2D\x31\x46\x22\x29\x2E\x44\x28\x22\x45\x22\x2C\x36\x28\x29\x7B\x24\x28\x22\x2E\x50\x2D\x31\x39\x22\x29\x2E\x70\x28\x22\x50\x2D\x31\x61\x22\x29\x7D\x29\x3B\x37\x20\x31\x73\x3D\x22\x31\x47\x3A\x2F\x2F\x32\x76\x2E\x32\x77\x2E\x32\x78\x2F\x76\x2F\x32\x79\x2E\x32\x7A\x22\x3B\x37\x20\x32\x41\x3D\x5B\x2C\x22\x32\x42\x22\x2C\x22\x32\x43\x22\x2C\x22\x32\x44\x22\x2C\x22\x32\x45\x22\x2C\x22\x32\x46\x22\x2C\x22\x32\x47\x22\x2C\x22\x32\x48\x22\x2C\x22\x32\x49\x22\x2C\x22\x32\x4A\x22\x2C\x22\x32\x4B\x22\x2C\x22\x32\x4C\x22\x2C\x22\x32\x4D\x22\x5D\x3B\x24\x28\x36\x28\x29\x7B\x37\x20\x65\x3D\x24\x28\x41\x29\x2E\x31\x62\x28\x29\x2C\x6F\x3D\x24\x28\x22\x2E\x46\x2D\x47\x22\x29\x2E\x32\x4E\x28\x29\x3B\x24\x28\x31\x74\x29\x2E\x56\x28\x36\x28\x29\x7B\x37\x20\x73\x3D\x24\x28\x41\x29\x2E\x31\x62\x28\x29\x3B\x24\x28\x41\x29\x2E\x31\x62\x28\x29\x3E\x3D\x32\x4F\x3F\x24\x28\x22\x2E\x46\x2D\x47\x22\x29\x2E\x31\x48\x28\x22\x31\x49\x22\x2C\x22\x31\x4A\x22\x29\x3A\x24\x28\x22\x2E\x46\x2D\x47\x22\x29\x2E\x31\x48\x28\x22\x31\x49\x22\x2C\x22\x31\x4A\x22\x29\x2C\x73\x3E\x6F\x3F\x24\x28\x22\x2E\x46\x2D\x47\x22\x29\x2E\x71\x28\x22\x56\x22\x29\x3A\x24\x28\x22\x2E\x46\x2D\x47\x22\x29\x2E\x70\x28\x22\x56\x22\x29\x2C\x73\x3E\x65\x3F\x24\x28\x22\x2E\x46\x2D\x47\x22\x29\x2E\x70\x28\x22\x77\x2D\x56\x22\x29\x3A\x24\x28\x22\x2E\x46\x2D\x47\x22\x29\x2E\x71\x28\x22\x77\x2D\x56\x22\x29\x2C\x65\x3D\x24\x28\x41\x29\x2E\x31\x62\x28\x29\x7D\x29\x7D\x29\x3B\x24\x28\x22\x2E\x48\x2D\x31\x4B\x20\x2E\x31\x4C\x20\x2E\x31\x4D\x2D\x49\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x37\x20\x65\x3D\x24\x28\x34\x29\x2E\x6B\x28\x22\x57\x22\x29\x2E\x67\x28\x22\x31\x75\x2D\x78\x22\x29\x2C\x74\x3D\x28\x24\x28\x34\x29\x2E\x6B\x28\x22\x57\x22\x29\x2E\x67\x28\x22\x31\x75\x2D\x77\x22\x29\x2C\x24\x28\x34\x29\x2E\x31\x76\x28\x29\x2E\x67\x28\x22\x31\x77\x22\x29\x29\x2C\x61\x3D\x24\x28\x34\x29\x2E\x6B\x28\x22\x57\x22\x29\x2E\x67\x28\x22\x31\x75\x2D\x31\x78\x22\x29\x3B\x61\x2E\x32\x50\x28\x22\x48\x22\x29\x26\x26\x24\x2E\x31\x4E\x28\x7B\x31\x63\x3A\x22\x2F\x31\x4F\x2F\x31\x64\x2F\x4A\x2F\x2D\x2F\x22\x2B\x65\x2B\x22\x3F\x31\x65\x3D\x31\x50\x2D\x31\x51\x2D\x31\x52\x26\x31\x53\x2D\x31\x54\x3D\x33\x22\x2C\x31\x78\x3A\x22\x31\x55\x22\x2C\x31\x56\x3A\x22\x31\x57\x22\x2C\x31\x58\x3A\x36\x28\x65\x29\x7B\x31\x66\x28\x37\x20\x61\x3D\x22\x22\x2C\x72\x3D\x22\x3C\x31\x59\x3E\x22\x2C\x6E\x3D\x30\x3B\x6E\x3C\x65\x2E\x38\x2E\x39\x2E\x31\x67\x3B\x6E\x2B\x2B\x29\x7B\x31\x66\x28\x37\x20\x69\x3D\x30\x3B\x69\x3C\x65\x2E\x38\x2E\x39\x5B\x6E\x5D\x2E\x51\x2E\x31\x67\x3B\x69\x2B\x2B\x29\x43\x28\x22\x31\x5A\x22\x3D\x3D\x65\x2E\x38\x2E\x39\x5B\x6E\x5D\x2E\x51\x5B\x69\x5D\x2E\x32\x30\x29\x7B\x61\x3D\x65\x2E\x38\x2E\x39\x5B\x6E\x5D\x2E\x51\x5B\x69\x5D\x2E\x7A\x3B\x32\x31\x7D\x37\x20\x6C\x3D\x65\x2E\x38\x2E\x39\x5B\x6E\x5D\x2E\x6A\x2E\x24\x74\x2C\x73\x3D\x65\x2E\x38\x2E\x39\x5B\x6E\x5D\x2E\x32\x32\x5B\x30\x5D\x2E\x32\x33\x2C\x64\x3D\x65\x2E\x38\x2E\x39\x5B\x6E\x5D\x2E\x49\x2E\x24\x74\x2C\x63\x3D\x24\x28\x22\x3C\x62\x3E\x22\x29\x2E\x31\x68\x28\x64\x29\x3B\x43\x28\x64\x2E\x31\x69\x28\x22\x2F\x2F\x32\x35\x2E\x32\x36\x2E\x31\x79\x2F\x32\x37\x2F\x22\x29\x3E\x2D\x31\x29\x37\x20\x66\x3D\x65\x2E\x38\x2E\x39\x5B\x6E\x5D\x2E\x32\x38\x24\x32\x39\x2E\x31\x63\x2C\x6F\x3D\x66\x3B\x31\x6A\x20\x43\x28\x64\x2E\x31\x69\x28\x22\x3C\x76\x22\x29\x3E\x2D\x31\x29\x37\x20\x68\x3D\x63\x2E\x6B\x28\x22\x76\x3A\x32\x61\x22\x29\x2E\x67\x28\x22\x31\x6B\x22\x29\x2C\x6F\x3D\x68\x3B\x31\x6A\x20\x37\x20\x6F\x3D\x31\x73\x3B\x72\x2B\x3D\x27\x3C\x31\x6C\x3E\x3C\x62\x20\x6D\x3D\x22\x32\x62\x22\x3E\x3C\x61\x20\x7A\x3D\x22\x27\x2B\x61\x2B\x27\x22\x3E\x3C\x76\x20\x31\x65\x3D\x22\x27\x2B\x6C\x2B\x27\x22\x20\x31\x6B\x3D\x22\x27\x2B\x6F\x2B\x27\x22\x20\x6A\x3D\x22\x27\x2B\x6C\x2B\x27\x22\x2F\x3E\x3C\x2F\x61\x3E\x3C\x2F\x62\x3E\x3C\x62\x20\x6D\x3D\x22\x48\x2D\x32\x51\x22\x3E\x3C\x61\x20\x6D\x3D\x22\x32\x52\x20\x27\x2B\x73\x2B\x27\x22\x20\x7A\x3D\x22\x2F\x32\x53\x2F\x78\x2F\x27\x2B\x73\x2B\x27\x22\x20\x6A\x3D\x22\x27\x2B\x73\x2B\x27\x22\x3E\x3C\x2F\x61\x3E\x3C\x2F\x62\x3E\x3C\x62\x20\x6D\x3D\x22\x48\x2D\x49\x22\x3E\x3C\x31\x6D\x20\x6D\x3D\x22\x48\x2D\x6A\x22\x3E\x3C\x61\x20\x7A\x3D\x22\x27\x2B\x61\x2B\x27\x22\x20\x6A\x3D\x22\x27\x2B\x6C\x2B\x27\x22\x3E\x27\x2B\x6C\x2B\x27\x3C\x2F\x61\x3E\x3C\x2F\x31\x6D\x3E\x3C\x2F\x62\x3E\x3C\x62\x20\x6D\x3D\x22\x32\x63\x22\x2F\x3E\x3C\x2F\x31\x6C\x3E\x27\x7D\x72\x2B\x3D\x22\x3C\x2F\x31\x59\x3E\x22\x2C\x24\x28\x22\x2E\x48\x2D\x31\x4B\x20\x2E\x31\x4C\x20\x2E\x31\x4D\x2D\x49\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x37\x20\x65\x3D\x24\x28\x34\x29\x2E\x31\x76\x28\x29\x2E\x67\x28\x22\x31\x77\x22\x29\x3B\x65\x3D\x3D\x74\x26\x26\x28\x24\x28\x34\x29\x2E\x31\x68\x28\x72\x29\x2C\x24\x28\x34\x29\x2E\x31\x76\x28\x29\x2E\x71\x28\x22\x48\x22\x29\x2C\x24\x28\x34\x29\x2E\x6B\x28\x22\x2E\x32\x62\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x24\x28\x34\x29\x2E\x67\x28\x22\x31\x6E\x22\x2C\x36\x28\x65\x2C\x74\x29\x7B\x4B\x20\x74\x2E\x52\x28\x22\x2F\x4A\x2E\x53\x22\x2C\x22\x2F\x31\x7A\x2E\x53\x22\x29\x7D\x29\x2E\x67\x28\x22\x31\x6E\x22\x2C\x36\x28\x65\x2C\x74\x29\x7B\x4B\x20\x74\x2E\x52\x28\x22\x31\x41\x2D\x63\x22\x2C\x22\x31\x42\x22\x29\x7D\x29\x7D\x29\x29\x7D\x29\x7D\x7D\x29\x7D\x29\x2C\x24\x28\x22\x23\x4C\x2D\x31\x64\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x37\x20\x65\x3D\x24\x28\x34\x29\x2E\x58\x28\x29\x3B\x24\x2E\x31\x4E\x28\x7B\x31\x63\x3A\x22\x2F\x31\x4F\x2F\x31\x64\x2F\x4A\x2F\x2D\x2F\x22\x2B\x65\x2B\x22\x3F\x31\x65\x3D\x31\x50\x2D\x31\x51\x2D\x31\x52\x26\x31\x53\x2D\x31\x54\x3D\x33\x22\x2C\x31\x78\x3A\x22\x31\x55\x22\x2C\x31\x56\x3A\x22\x31\x57\x22\x2C\x31\x58\x3A\x36\x28\x65\x29\x7B\x31\x66\x28\x37\x20\x74\x3D\x22\x22\x2C\x61\x3D\x27\x3C\x62\x20\x6D\x3D\x22\x4C\x2D\x32\x54\x22\x3E\x27\x2C\x72\x3D\x30\x3B\x72\x3C\x65\x2E\x38\x2E\x39\x2E\x31\x67\x3B\x72\x2B\x2B\x29\x7B\x31\x66\x28\x37\x20\x6E\x3D\x30\x3B\x6E\x3C\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x51\x2E\x31\x67\x3B\x6E\x2B\x2B\x29\x43\x28\x22\x31\x5A\x22\x3D\x3D\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x51\x5B\x6E\x5D\x2E\x32\x30\x29\x7B\x74\x3D\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x51\x5B\x6E\x5D\x2E\x7A\x3B\x32\x31\x7D\x37\x20\x69\x3D\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x6A\x2E\x24\x74\x2C\x6C\x3D\x28\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x32\x32\x5B\x30\x5D\x2E\x32\x33\x2C\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x32\x55\x5B\x30\x5D\x2E\x32\x56\x2E\x24\x74\x2C\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x49\x2E\x24\x74\x29\x2C\x73\x3D\x24\x28\x22\x3C\x62\x3E\x22\x29\x2E\x31\x68\x28\x6C\x29\x3B\x43\x28\x6C\x2E\x31\x69\x28\x22\x2F\x2F\x32\x35\x2E\x32\x36\x2E\x31\x79\x2F\x32\x37\x2F\x22\x29\x3E\x2D\x31\x29\x37\x20\x64\x3D\x65\x2E\x38\x2E\x39\x5B\x72\x5D\x2E\x32\x38\x24\x32\x39\x2E\x31\x63\x2E\x52\x28\x22\x2F\x4A\x2E\x53\x22\x2C\x22\x2F\x31\x7A\x2E\x53\x22\x29\x2C\x63\x3D\x64\x3B\x31\x6A\x20\x43\x28\x6C\x2E\x31\x69\x28\x22\x3C\x76\x22\x29\x3E\x2D\x31\x29\x37\x20\x66\x3D\x73\x2E\x6B\x28\x22\x76\x3A\x32\x61\x22\x29\x2E\x67\x28\x22\x31\x6B\x22\x29\x2E\x52\x28\x22\x31\x41\x2D\x63\x22\x2C\x22\x31\x42\x22\x29\x2C\x63\x3D\x66\x3B\x31\x6A\x20\x37\x20\x63\x3D\x31\x73\x3B\x61\x2B\x3D\x27\x3C\x31\x6C\x3E\x3C\x62\x20\x6D\x3D\x22\x4C\x2D\x76\x22\x3E\x3C\x61\x20\x7A\x3D\x22\x27\x2B\x74\x2B\x27\x22\x3E\x3C\x76\x20\x31\x65\x3D\x22\x27\x2B\x69\x2B\x27\x22\x20\x31\x6B\x3D\x22\x27\x2B\x63\x2B\x27\x22\x20\x6A\x3D\x22\x27\x2B\x69\x2B\x27\x22\x2F\x3E\x3C\x2F\x61\x3E\x3C\x2F\x62\x3E\x3C\x62\x20\x6D\x3D\x22\x4C\x2D\x49\x22\x3E\x3C\x31\x6D\x20\x6D\x3D\x22\x4C\x2D\x6A\x22\x3E\x3C\x61\x20\x7A\x3D\x22\x27\x2B\x74\x2B\x27\x22\x20\x6A\x3D\x22\x27\x2B\x69\x2B\x27\x22\x3E\x27\x2B\x69\x2B\x22\x3C\x2F\x61\x3E\x3C\x2F\x31\x6D\x3E\x3C\x2F\x62\x3E\x3C\x2F\x31\x6C\x3E\x22\x7D\x61\x2B\x3D\x27\x3C\x2F\x62\x3E\x3C\x62\x20\x6D\x3D\x22\x32\x63\x22\x2F\x3E\x27\x2C\x24\x28\x22\x23\x4C\x2D\x31\x64\x22\x29\x2E\x31\x68\x28\x61\x29\x2C\x24\x28\x34\x29\x2E\x6B\x28\x22\x2E\x4C\x2D\x76\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x24\x28\x34\x29\x2E\x67\x28\x22\x31\x6E\x22\x2C\x36\x28\x65\x2C\x74\x29\x7B\x4B\x20\x74\x2E\x52\x28\x22\x2F\x4A\x2E\x53\x22\x2C\x22\x2F\x31\x7A\x2E\x53\x22\x29\x7D\x29\x2E\x67\x28\x22\x31\x6E\x22\x2C\x36\x28\x65\x2C\x74\x29\x7B\x4B\x20\x74\x2E\x52\x28\x22\x31\x41\x2D\x63\x22\x2C\x22\x31\x42\x22\x29\x7D\x29\x7D\x29\x7D\x7D\x29\x7D\x29\x3B\x36\x20\x32\x64\x28\x65\x29\x7B\x37\x20\x74\x3D\x21\x30\x3B\x43\x28\x35\x28\x22\x23\x22\x2B\x65\x2B\x22\x20\x2E\x31\x6F\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x22\x22\x21\x3D\x24\x2E\x31\x70\x28\x35\x28\x34\x29\x2E\x54\x28\x29\x29\x26\x26\x22\x4A\x22\x21\x3D\x24\x2E\x31\x70\x28\x35\x28\x34\x29\x2E\x54\x28\x29\x29\x7C\x7C\x35\x28\x34\x29\x2E\x71\x28\x22\x59\x22\x29\x7D\x29\x2C\x35\x28\x22\x23\x22\x2B\x65\x2B\x22\x20\x2E\x31\x6F\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x4B\x22\x22\x3D\x3D\x24\x2E\x31\x70\x28\x35\x28\x34\x29\x2E\x54\x28\x29\x29\x3F\x28\x74\x3D\x21\x31\x2C\x35\x28\x34\x29\x2E\x4D\x28\x22\x78\x22\x29\x2E\x6B\x28\x22\x2E\x5A\x22\x29\x2E\x71\x28\x22\x4E\x22\x29\x2C\x35\x28\x34\x29\x2E\x59\x28\x29\x2C\x21\x31\x29\x3A\x22\x4A\x22\x3D\x3D\x24\x2E\x31\x70\x28\x35\x28\x34\x29\x2E\x54\x28\x29\x29\x3F\x28\x74\x3D\x21\x31\x2C\x35\x28\x34\x29\x2E\x4D\x28\x22\x78\x22\x29\x2E\x6B\x28\x22\x2E\x5A\x22\x29\x2E\x71\x28\x22\x4E\x22\x29\x2C\x21\x31\x29\x3A\x32\x57\x20\x30\x7D\x29\x2C\x74\x3D\x3D\x3D\x21\x30\x29\x7B\x37\x20\x69\x3D\x22\x22\x2C\x61\x3D\x22\x31\x47\x3A\x2F\x2F\x32\x58\x2E\x31\x71\x2E\x31\x79\x2F\x32\x65\x22\x3B\x43\x28\x2F\x32\x59\x7C\x32\x5A\x7C\x33\x30\x7C\x33\x31\x7C\x33\x32\x7C\x33\x33\x7C\x33\x34\x7C\x33\x35\x20\x33\x36\x2F\x69\x2E\x33\x37\x28\x33\x38\x2E\x33\x39\x29\x26\x26\x28\x61\x3D\x22\x31\x71\x3A\x2F\x2F\x32\x65\x22\x29\x2C\x22\x33\x61\x22\x3D\x3D\x3D\x65\x29\x37\x20\x73\x3D\x33\x62\x2C\x72\x3D\x33\x63\x2C\x6E\x3D\x22\x33\x64\x22\x2C\x6F\x3D\x22\x33\x65\x22\x2C\x6C\x3D\x28\x35\x28\x22\x23\x22\x2B\x65\x2B\x22\x20\x2E\x6A\x2D\x49\x22\x29\x2E\x58\x28\x29\x2C\x35\x28\x22\x23\x22\x2B\x65\x2B\x22\x20\x2E\x33\x66\x22\x29\x2E\x54\x28\x29\x29\x2C\x69\x3D\x61\x2B\x22\x3F\x33\x67\x3D\x22\x2B\x73\x2B\x72\x2B\x22\x26\x58\x3D\x2A\x22\x2B\x6F\x2B\x22\x20\x22\x2B\x6E\x2B\x22\x2E\x2E\x2E\x2A\x20\x25\x32\x66\x25\x32\x66\x22\x2B\x6C\x3B\x35\x28\x34\x29\x2E\x67\x28\x22\x7A\x22\x2C\x69\x29\x3B\x37\x20\x75\x3D\x33\x68\x2C\x68\x3D\x33\x69\x2C\x63\x3D\x32\x67\x28\x32\x68\x2E\x32\x69\x2F\x32\x2D\x75\x2F\x32\x29\x2C\x64\x3D\x32\x67\x28\x32\x68\x2E\x32\x6A\x2F\x32\x2D\x68\x2F\x32\x29\x2C\x79\x3D\x31\x74\x2E\x31\x46\x28\x34\x2E\x7A\x2C\x22\x22\x2C\x22\x33\x6A\x3D\x77\x2C\x20\x33\x6B\x3D\x77\x2C\x20\x33\x6C\x3D\x77\x2C\x20\x33\x6D\x3D\x77\x2C\x20\x33\x6E\x3D\x77\x2C\x20\x33\x6F\x3D\x33\x70\x2C\x20\x33\x71\x3D\x31\x2C\x20\x33\x72\x3D\x77\x2C\x20\x32\x69\x3D\x22\x2B\x75\x2B\x22\x2C\x20\x32\x6A\x3D\x22\x2B\x68\x2B\x22\x2C\x20\x33\x73\x3D\x22\x2B\x64\x2B\x22\x2C\x20\x33\x74\x3D\x22\x2B\x63\x29\x3B\x4B\x20\x79\x2E\x59\x28\x29\x2C\x21\x31\x7D\x7D\x31\x74\x2E\x33\x75\x28\x22\x33\x76\x22\x2C\x36\x28\x29\x7B\x37\x20\x65\x3D\x35\x28\x22\x6A\x22\x29\x2E\x58\x28\x29\x3B\x35\x28\x22\x2E\x33\x77\x22\x29\x2E\x44\x28\x22\x45\x22\x2C\x36\x28\x29\x7B\x35\x28\x34\x29\x2E\x70\x28\x22\x4E\x22\x29\x2C\x35\x28\x22\x6A\x22\x29\x2E\x58\x28\x65\x29\x7D\x29\x2C\x35\x28\x22\x2E\x4F\x20\x33\x78\x2C\x20\x2E\x4F\x20\x33\x79\x22\x29\x2E\x44\x28\x22\x33\x7A\x22\x2C\x36\x28\x29\x7B\x31\x33\x3D\x3D\x3D\x33\x41\x2E\x33\x42\x26\x26\x35\x28\x34\x29\x2E\x4D\x28\x22\x2E\x4F\x22\x29\x2E\x6B\x28\x22\x2E\x32\x6B\x22\x29\x2E\x33\x43\x28\x22\x45\x22\x29\x7D\x29\x2C\x35\x28\x22\x2E\x4F\x20\x2E\x31\x6F\x22\x29\x2E\x42\x28\x36\x28\x29\x7B\x6A\x3D\x35\x28\x34\x29\x2E\x67\x28\x22\x33\x44\x22\x29\x2C\x78\x3D\x35\x28\x34\x29\x2E\x4D\x28\x22\x78\x22\x29\x2C\x35\x28\x27\x3C\x57\x20\x6D\x3D\x22\x5A\x22\x3E\x28\x33\x45\x29\x3C\x2F\x57\x3E\x27\x29\x2E\x33\x46\x28\x78\x29\x7D\x29\x2C\x35\x28\x22\x2E\x4F\x20\x2E\x31\x6F\x22\x29\x2E\x33\x47\x28\x36\x28\x29\x7B\x22\x22\x21\x3D\x35\x28\x34\x29\x2E\x54\x28\x29\x26\x26\x28\x35\x28\x34\x29\x2E\x70\x28\x22\x59\x22\x29\x2C\x35\x28\x34\x29\x2E\x4D\x28\x22\x78\x22\x29\x2E\x6B\x28\x22\x2E\x5A\x22\x29\x2E\x70\x28\x22\x4E\x22\x29\x29\x7D\x29\x2C\x35\x28\x22\x2E\x4F\x20\x33\x48\x22\x29\x2E\x33\x49\x28\x36\x28\x29\x7B\x35\x28\x34\x29\x2E\x70\x28\x22\x59\x22\x29\x2C\x35\x28\x34\x29\x2E\x4D\x28\x22\x78\x22\x29\x2E\x6B\x28\x22\x2E\x5A\x22\x29\x2E\x70\x28\x22\x4E\x22\x29\x7D\x29\x7D\x2C\x21\x31\x29\x2C\x35\x28\x22\x2E\x4F\x20\x2E\x32\x6B\x22\x29\x2E\x44\x28\x22\x45\x22\x2C\x36\x28\x29\x7B\x4B\x20\x32\x64\x28\x35\x28\x34\x29\x2E\x4D\x28\x22\x2E\x33\x4A\x22\x29\x2E\x67\x28\x22\x31\x77\x22\x29\x29\x2C\x21\x31\x7D\x29\x2C\x24\x28\x41\x29\x2E\x44\x28\x22\x45\x22\x2C\x22\x2E\x31\x61\x2D\x31\x43\x22\x2C\x36\x28\x29\x7B\x24\x28\x22\x23\x31\x71\x2D\x31\x43\x22\x29\x2E\x71\x28\x22\x32\x6C\x22\x29\x2E\x70\x28\x22\x4E\x22\x29\x7D\x29\x2C\x24\x28\x41\x29\x2E\x44\x28\x22\x45\x22\x2C\x22\x2E\x33\x4B\x2D\x33\x4C\x22\x2C\x36\x28\x29\x7B\x24\x28\x22\x23\x31\x71\x2D\x31\x43\x22\x29\x2E\x71\x28\x22\x4E\x22\x29\x2E\x70\x28\x22\x32\x6C\x22\x29\x7D\x29\x3B","\x7C","\x73\x70\x6C\x69\x74","\x7C\x7C\x7C\x7C\x74\x68\x69\x73\x7C\x6A\x51\x75\x65\x72\x79\x7C\x66\x75\x6E\x63\x74\x69\x6F\x6E\x7C\x76\x61\x72\x7C\x66\x65\x65\x64\x7C\x65\x6E\x74\x72\x79\x7C\x7C\x64\x69\x76\x7C\x7C\x7C\x7C\x7C\x61\x74\x74\x72\x7C\x7C\x7C\x74\x69\x74\x6C\x65\x7C\x66\x69\x6E\x64\x7C\x7C\x63\x6C\x61\x73\x73\x7C\x7C\x7C\x72\x65\x6D\x6F\x76\x65\x43\x6C\x61\x73\x73\x7C\x61\x64\x64\x43\x6C\x61\x73\x73\x7C\x7C\x7C\x7C\x7C\x69\x6D\x67\x7C\x6E\x6F\x7C\x6C\x61\x62\x65\x6C\x7C\x7C\x68\x72\x65\x66\x7C\x64\x6F\x63\x75\x6D\x65\x6E\x74\x7C\x65\x61\x63\x68\x7C\x69\x66\x7C\x6F\x6E\x7C\x63\x6C\x69\x63\x6B\x7C\x68\x65\x61\x64\x65\x72\x7C\x66\x69\x78\x65\x64\x7C\x72\x65\x63\x65\x6E\x74\x7C\x63\x6F\x6E\x74\x65\x6E\x74\x7C\x64\x65\x66\x61\x75\x6C\x74\x7C\x72\x65\x74\x75\x72\x6E\x7C\x72\x65\x6C\x61\x74\x65\x64\x7C\x70\x61\x72\x65\x6E\x74\x73\x7C\x73\x68\x6F\x77\x7C\x66\x6F\x72\x6D\x57\x41\x7C\x73\x69\x64\x65\x62\x61\x72\x7C\x6C\x69\x6E\x6B\x7C\x72\x65\x70\x6C\x61\x63\x65\x7C\x6A\x70\x67\x7C\x76\x61\x6C\x7C\x41\x4D\x7C\x73\x63\x72\x6F\x6C\x6C\x7C\x73\x70\x61\x6E\x7C\x74\x65\x78\x74\x7C\x66\x6F\x63\x75\x73\x7C\x76\x61\x6C\x69\x64\x61\x73\x69\x7C\x7C\x63\x6F\x6E\x73\x6F\x6C\x65\x7C\x7C\x7C\x6C\x6F\x67\x7C\x54\x68\x65\x7C\x74\x69\x6D\x65\x7C\x69\x73\x7C\x50\x4D\x7C\x6D\x65\x6E\x75\x7C\x63\x6C\x6F\x73\x65\x7C\x73\x63\x72\x6F\x6C\x6C\x54\x6F\x70\x7C\x75\x72\x6C\x7C\x70\x6F\x73\x74\x73\x7C\x61\x6C\x74\x7C\x66\x6F\x72\x7C\x6C\x65\x6E\x67\x74\x68\x7C\x68\x74\x6D\x6C\x7C\x69\x6E\x64\x65\x78\x4F\x66\x7C\x65\x6C\x73\x65\x7C\x73\x72\x63\x7C\x6C\x69\x7C\x68\x33\x7C\x73\x74\x79\x6C\x65\x7C\x77\x61\x6A\x69\x62\x7C\x74\x72\x69\x6D\x7C\x77\x68\x61\x74\x73\x61\x70\x70\x7C\x63\x6C\x6F\x63\x6B\x7C\x6E\x6F\x5F\x69\x6D\x61\x67\x65\x7C\x77\x69\x6E\x64\x6F\x77\x7C\x64\x61\x74\x61\x7C\x70\x61\x72\x65\x6E\x74\x7C\x69\x64\x7C\x74\x79\x70\x65\x7C\x63\x6F\x6D\x7C\x6D\x71\x64\x65\x66\x61\x75\x6C\x74\x7C\x73\x37\x32\x7C\x73\x31\x36\x30\x30\x7C\x63\x68\x61\x74\x7C\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64\x7C\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C\x7C\x6F\x70\x65\x6E\x7C\x68\x74\x74\x70\x73\x7C\x63\x73\x73\x7C\x70\x6F\x73\x69\x74\x69\x6F\x6E\x7C\x73\x74\x69\x63\x6B\x79\x7C\x67\x6F\x6F\x6D\x7C\x48\x54\x4D\x4C\x7C\x77\x69\x64\x67\x65\x74\x7C\x61\x6A\x61\x78\x7C\x66\x65\x65\x64\x73\x7C\x6A\x73\x6F\x6E\x7C\x69\x6E\x7C\x73\x63\x72\x69\x70\x74\x7C\x6D\x61\x78\x7C\x72\x65\x73\x75\x6C\x74\x73\x7C\x67\x65\x74\x7C\x64\x61\x74\x61\x54\x79\x70\x65\x7C\x6A\x73\x6F\x6E\x70\x7C\x73\x75\x63\x63\x65\x73\x73\x7C\x75\x6C\x7C\x61\x6C\x74\x65\x72\x6E\x61\x74\x65\x7C\x72\x65\x6C\x7C\x62\x72\x65\x61\x6B\x7C\x63\x61\x74\x65\x67\x6F\x72\x79\x7C\x74\x65\x72\x6D\x7C\x7C\x77\x77\x77\x7C\x79\x6F\x75\x74\x75\x62\x65\x7C\x65\x6D\x62\x65\x64\x7C\x6D\x65\x64\x69\x61\x7C\x74\x68\x75\x6D\x62\x6E\x61\x69\x6C\x7C\x66\x69\x72\x73\x74\x7C\x72\x6D\x67\x7C\x63\x6C\x72\x7C\x6B\x69\x72\x69\x6D\x57\x41\x7C\x73\x65\x6E\x64\x7C\x30\x41\x7C\x4E\x75\x6D\x62\x65\x72\x7C\x73\x63\x72\x65\x65\x6E\x7C\x77\x69\x64\x74\x68\x7C\x68\x65\x69\x67\x68\x74\x7C\x73\x75\x62\x6D\x69\x74\x7C\x68\x69\x64\x65\x7C\x6E\x65\x77\x7C\x44\x61\x74\x65\x7C\x67\x65\x74\x4D\x69\x6E\x75\x74\x65\x73\x7C\x67\x65\x74\x53\x65\x63\x6F\x6E\x64\x73\x7C\x67\x65\x74\x48\x6F\x75\x72\x73\x7C\x68\x6F\x75\x72\x73\x7C\x6D\x69\x6E\x75\x74\x65\x73\x7C\x73\x65\x74\x49\x6E\x74\x65\x72\x76\x61\x6C\x7C\x31\x65\x33\x7C\x67\x6F\x6F\x6D\x73\x69\x74\x65\x7C\x67\x69\x74\x68\x75\x62\x7C\x69\x6F\x7C\x6E\x6F\x6E\x7C\x77\x65\x62\x70\x7C\x6D\x6F\x6E\x74\x68\x5F\x66\x6F\x72\x6D\x61\x74\x7C\x4A\x61\x6E\x7C\x46\x65\x62\x7C\x4D\x61\x72\x7C\x41\x70\x72\x7C\x4D\x61\x79\x7C\x4A\x75\x6E\x7C\x4A\x75\x6C\x7C\x41\x75\x67\x7C\x53\x65\x70\x74\x7C\x4F\x63\x74\x7C\x4E\x6F\x76\x7C\x44\x65\x63\x7C\x6F\x75\x74\x65\x72\x48\x65\x69\x67\x68\x74\x7C\x35\x30\x7C\x6D\x61\x74\x63\x68\x7C\x74\x61\x67\x7C\x69\x63\x6F\x6E\x7C\x73\x65\x61\x72\x63\x68\x7C\x77\x72\x61\x70\x7C\x61\x75\x74\x68\x6F\x72\x7C\x6E\x61\x6D\x65\x7C\x76\x6F\x69\x64\x7C\x77\x65\x62\x7C\x41\x6E\x64\x72\x6F\x69\x64\x7C\x77\x65\x62\x4F\x53\x7C\x69\x50\x68\x6F\x6E\x65\x7C\x69\x50\x61\x64\x7C\x69\x50\x6F\x64\x7C\x42\x6C\x61\x63\x6B\x42\x65\x72\x72\x79\x7C\x49\x45\x4D\x6F\x62\x69\x6C\x65\x7C\x4F\x70\x65\x72\x61\x7C\x4D\x69\x6E\x69\x7C\x74\x65\x73\x74\x7C\x6E\x61\x76\x69\x67\x61\x74\x6F\x72\x7C\x75\x73\x65\x72\x41\x67\x65\x6E\x74\x7C\x6B\x6F\x6E\x73\x75\x6C\x74\x61\x73\x69\x7C\x36\x32\x7C\x38\x31\x32\x34\x31\x31\x30\x35\x36\x35\x38\x7C\x41\x64\x6D\x69\x6E\x7C\x48\x65\x6C\x6C\x6F\x7C\x70\x65\x73\x61\x6E\x7C\x70\x68\x6F\x6E\x65\x7C\x39\x36\x30\x7C\x35\x34\x30\x7C\x74\x6F\x6F\x6C\x62\x61\x72\x7C\x6C\x6F\x63\x61\x74\x69\x6F\x6E\x7C\x64\x69\x72\x65\x63\x74\x6F\x72\x69\x65\x73\x7C\x73\x74\x61\x74\x75\x73\x7C\x6D\x65\x6E\x75\x62\x61\x72\x7C\x73\x63\x72\x6F\x6C\x6C\x62\x61\x72\x73\x7C\x79\x65\x73\x7C\x72\x65\x73\x69\x7A\x61\x62\x6C\x65\x7C\x63\x6F\x70\x79\x68\x69\x73\x74\x6F\x72\x79\x7C\x74\x6F\x70\x7C\x6C\x65\x66\x74\x7C\x61\x64\x64\x45\x76\x65\x6E\x74\x4C\x69\x73\x74\x65\x6E\x65\x72\x7C\x6C\x6F\x61\x64\x7C\x77\x61\x46\x69\x78\x7C\x69\x6E\x70\x75\x74\x7C\x74\x65\x78\x74\x61\x72\x65\x61\x7C\x6B\x65\x79\x70\x72\x65\x73\x73\x7C\x65\x76\x65\x6E\x74\x7C\x6B\x65\x79\x43\x6F\x64\x65\x7C\x74\x72\x69\x67\x67\x65\x72\x7C\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72\x7C\x52\x65\x71\x75\x69\x72\x65\x64\x7C\x61\x70\x70\x65\x6E\x64\x54\x6F\x7C\x6B\x65\x79\x75\x70\x7C\x73\x65\x6C\x65\x63\x74\x7C\x63\x68\x61\x6E\x67\x65\x7C\x70\x6F\x70\x74\x61\x6D\x76\x7C\x6E\x61\x62\x69\x6C\x7C\x6C\x69\x76\x65","","\x66\x72\x6F\x6D\x43\x68\x61\x72\x43\x6F\x64\x65","\x72\x65\x70\x6C\x61\x63\x65","\x5C\x77\x2B","\x5C\x62","\x67"];eval(function(_0x5c3dx1,_0x5c3dx2,_0x5c3dx3,_0x5c3dx4,_0x5c3dx5,_0x5c3dx6){_0x5c3dx5= function(_0x5c3dx3){return (_0x5c3dx3< _0x5c3dx2?_0xc3f1[4]:_0x5c3dx5(parseInt(_0x5c3dx3/ _0x5c3dx2)))+ ((_0x5c3dx3= _0x5c3dx3% _0x5c3dx2)> 35?String[_0xc3f1[5]](_0x5c3dx3+ 29):_0x5c3dx3.toString(36))};if(!_0xc3f1[4][_0xc3f1[6]](/^/,String)){while(_0x5c3dx3--){_0x5c3dx6[_0x5c3dx5(_0x5c3dx3)]= _0x5c3dx4[_0x5c3dx3]|| _0x5c3dx5(_0x5c3dx3)};_0x5c3dx4= [function(_0x5c3dx5){return _0x5c3dx6[_0x5c3dx5]}];_0x5c3dx5= function(){return _0xc3f1[7]};_0x5c3dx3= 1};while(_0x5c3dx3--){if(_0x5c3dx4[_0x5c3dx3]){_0x5c3dx1= _0x5c3dx1[_0xc3f1[6]]( new RegExp(_0xc3f1[8]+ _0x5c3dx5(_0x5c3dx3)+ _0xc3f1[8],_0xc3f1[9]),_0x5c3dx4[_0x5c3dx3])}};return _0x5c3dx1}(_0xc3f1[0],62,234,_0xc3f1[3][_0xc3f1[2]](_0xc3f1[1]),0,{}))
That code is encrypted.
You can check _0xc3f1 contents with console.log, however there is some decryting part after _0xc3f1 definition that need to be executed step by step and will regenerate the code inside a inner function, so if you change that decrypting part you can get the code, specially if you check the eval part.
You will need some time, javascript programming and debugging skills.
Totally lacking intuition here.
First i thought i only happens when copying and pasting code from editor. Unfortunately it's more common. Only thing I am doing is trying to insert more code somewhere in the middle of current input or modifying it.
Expected behavior:
Modify input without side effects.
What actually happens:
VERY OFTEN when modifying input it gets messed up.
If that happens every key press will copy and insert current input alongside with pressed character.
Vital notes:
Encoding is set to UTF-8 in terminal(s)
Issue persists on different emulators ( Terminator, gnome-terminal )
Issue persists when using different Ruby runtime console ( IRB, Pry )
Issue appears to be related to Ruby runtime, NOT Linux shell (i guess...)
Issue appears since:
Since system install. Didn't appear on my MacBook Air
System:
ArchLinux, although coworker reported same thing happens on his MacBook Pro.
How to reproduce (works for me):
Open rails console
Type example code: Shift.where(name: "som").where(name: "dom").where(name: "pom")
Navigate cursor to modify first where statement.
Change "som" to "SOM"
Should see it break
Press random key repeatedly to see it break even more.
Images:
Good input
Now i will navigate to first where statement to change "som" to uppercase "SOM"
I basically navigated my cursor and pressed SHIFT+S, SHIFT+O, SHIFT+M
Hope it's clear enough :-)
Thank you!
EDIT 1:
Tried using zsh instead of bash, didn't help
Disabled spring gem, didn't help
EDIT 2:
Folks on reddit suggested that i should check if there are any Ruby readline warnings eg. "Readline is not installed". None of them appear anywhere. Also reinstalled ruby 2.4.1, seems like it's not the problem in my case.
EDIT 3:
I cannot reproduce the issue in a different Rails project.
Issue appears on Rails 5.1.1, meanwhile 5.0.3 works flawlessly.
Is it possible that Rails itself (or rather one of its gems) can be the cause?
I had a very similar issue, and I boiled it down to my coloring.
I had the following in my IRBRC:
class String
def _colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def red
_colorize(31)
end
def yellow
_colorize(33)
end
end
IRB.conf[:PROMPT][:MY_PROMPT] = {
:AUTO_INDENT => true, # enables auto-indent mode
:PROMPT_I => "[ME]".red + " > ".yellow, # normal prompt
:PROMPT_S => "[ME]".red + " ".yellow, # prompt for continuated strings
:PROMPT_C => "[ME]".red + " * ".yellow, # prompt for continuated statement
:RETURN => "[ME]".red + "=> ".yellow + "%s\n".red # format to return value
}
IRB.conf[:PROMPT_MODE] = :MY_PROMPT
And when I removed the .red and .yellow, everything was just fine.
I think it's because my coloring characters like \e[31m was getting counted as a length 5 characters instead of 0 characters.
My solution was to remove my coloring for the time being. Hopefully someone will come up with a better solution than that.
I am working on ROR app , with ruby debugger. This is my code:
def render(d)
debugger
folder=d.folders
folders,empty_folders=check_empty_folder(folder)
c = cost(folders)
end
Now in console the break point at folders=d.folders . Now if i do next near around 30 times then it come to next line in this function folders,empty_folders after going through different ruby source file.
Is there any command I can simply go into next line of function in spite of source code.