0

Problem

When I was using Windows, the "Arrow Up" button would continue where it left off in the Python REPL in the terminal, meaning: say I wrote lines l_1, l_2, l_3, l_4 in that order. Then I use arrow up three times to write l_2 again. Now how it used to be was, if I use arrow up/arrow down again, I would end up with l_1/l_3, so it remembers where I last 'went to' (see example in the end). This was very useful whenever I wanted to rewrite a large number of code lines in the same order. Now I switched to Ubuntu, and the arrow up button will always start from the beginning again, i.e. if I used it three times to get to l_2, then write line l_2, the next arrow up would give me l_2 again instead of l_1, as l_2 was the last line written. I'm not even sure if this is a Python or Windows/Linux specific setting, but does anyone have an idea how I can get it to do what it used to again?

Example

(In case it didn't become clear what I mean.)
Say I wrote the following in the Python REPL:

>>> x=0
>>> for i in range(10):
...     x += i
...     x *= 2

and I want to type the same code fragment once again, I want to be able to rewrite these four lines by using the arrow up button 4 times to acces the first line, x = 0, write this line, and after that lines 2-4 should be accessible, in that order, via a single 'arrow down'. However, right now, if I do arrow up 4 times to write x = 0, after that the 'position the arrow keys are at' resets, and arrow down won't give me anything, whereas for writing the second line of code, for i in range(10), I would have to use arrow up 4 times again (not 3, because I have already added a new line of code x = 0). For large chunks of code, this becomes way more tedious.

joinijo
  • 353
  • 2
  • 9

0 Answers0