You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Macos and I am unable to use the navigation keys to jump into my previous Repl line, Instead it showing me escape characters.
Abduls-Air:better-exceptions abdulniyas$ python3 -m better_exceptions
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(BetterExceptionsConsole)
>>> import sys
>>> ^[[A # This is what I am getting when I press Up arrow.
I tried the same in my python interpreter but it does shows me the correct result.
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> import platform # It shows the correct result when I press Up arrow.
I think sys.__interactivehook__ is not getting called(in order register the readline) while initialising better-exception Repl. So if I do the following in better-exception Repl I am getting correct result.
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(BetterExceptionsConsole)
>>> a = 0
>>> ^[[A # while clicking up arrow.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/code.py", line 64, in runsource
code = self.compile(source, filename, symbol)
│ │ │ └ 'single'
│ │ └ '@@@REPL@@@1'
│ └ '\x1b[A'
└ <better_exceptions.repl.BetterExceptionsConsole object at 0x10249a048>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/codeop.py", line 168, in __call__
return _maybe_compile(self.compiler, source, filename, symbol)
│ │ │ │ └ 'single'
│ │ │ └ '@@@REPL@@@1'
│ │ └ '\x1b[A'
│ └ <codeop.CommandCompiler object at 0x10249a080>
└ <function _maybe_compile at 0x1024961e0>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/codeop.py", line 99, in _maybe_compile
raise err1
└ SyntaxError('invalid syntax', ('@@@REPL@@@1', 1, 1, '\x1b[A\n'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/codeop.py", line 87, in _maybe_compile
code1 = compiler(source + '
'", filename, symbol)
│ │ │ │ └ 'single'
│ │ │ └ '@@@REPL@@@1'
│ │ └ '\x1b[A'
│ └ <codeop.Compile object at 0x10249a0b8>
└ None
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/codeop.py", line 133, in __call__
codeob = compile(source, filename, symbol, self.flags, 1)
│ │ │ └ <codeop.Compile object at 0x10249a0b8>
│ │ └ 'single'
│ └ '@@@REPL@@@1'
└ '\x1b[A\n'
File "@@@REPL@@@1", line 1
^
SyntaxError: invalid syntax
>>> import sys
>>> sys.__interactivehook__() # Register the readline
>>> # Now onwards the navigation keys are working
The text was updated successfully, but these errors were encountered:
I am using Macos and I am unable to use the navigation keys to jump into my previous Repl line, Instead it showing me escape characters.
I tried the same in my python interpreter but it does shows me the correct result.
I think
sys.__interactivehook__
is not getting called(in order register the readline) while initialisingbetter-exception
Repl. So if I do the following inbetter-exception
Repl I am getting correct result.The text was updated successfully, but these errors were encountered: