Pablo Galindo Salgado
09968dd2a9
gh-148105: _pyrepl: switch console refresh to structured rendered screens ( #146584 )
2026-04-08 23:42:26 +01:00
Pablo Galindo Salgado
f8293faf37
gh-130472: Remove readline-only hacks from PyREPL completions ( #148161 )
...
PyREPL was still carrying over two readline-specific tricks from the
fancy completer: a synthetic CSI prefix to influence sorting and a fake
blank completion entry to suppress readline's prefix insertion. Those
workarounds are not appropriate in PyREPL because the reader already
owns completion ordering and menu rendering, so the fake entries leaked
into the UI as real terminal attributes and empty menu cells.
Sort completion candidates in ReadlineAlikeReader by their visible text
with stripcolor(), and let the fancy completer return only real matches.
That keeps colored completions stable without emitting bogus escape
sequences, removes the empty completion slot, and adds regression tests
for both the low-level completer output and the reader integration.
2026-04-06 14:57:25 +00:00
Loïc Simon
b07becb573
gh-140870: PyREPL auto-complete module attributes in import statements ( #140871 )
...
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2026-04-05 19:10:59 +00:00
Loïc Simon
c64baff1d8
gh-69605: Add math.integer to PyREPL module completer hardcoded list ( #144811 )
2026-04-05 19:31:19 +01:00
Antonio Cuni
1c4408aeca
gh-130472: Integrate fancycompleter with the new repl, to get colored tab completions ( #130473 )
...
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2026-04-05 14:23:07 +00:00
Victor Stinner
97babb8ef7
gh-143394: Skip pyrepl test_no_newline() basic REPL if readline is missing ( #147973 )
2026-04-02 13:45:59 +02:00
Tan Long
e13f6dccd7
gh-140131: Fix REPL cursor position on Windows when module completion suggestion line hits console width (GH-140333)
2026-03-12 16:59:43 +01:00
Łukasz Langa
7dae1077cd
gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH-143461)
2026-01-06 11:10:18 +01:00
Chris Eibl
04ace41fe2
gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433)
2026-01-05 22:46:08 +01:00
Łukasz Langa
4f9a8d075e
gh-69605: In test_pyrepl.test_already_imported*, invalidate FS import caches ( #143436 )
...
This makes the test robust against file systems with low timestamp resolution, which otherwise would fail to re-import in the tight loop of the test.
2026-01-05 18:00:48 +01:00
Loïc Simon
bfac54d861
gh-69605: Check for already imported modules in PyREPL module completion (GH-139461)
...
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2026-01-05 16:18:54 +01:00
Łukasz Langa
08a17ed061
gh-128067: In test_pyrepl, discover escape sequences from terminfo instead of using hard-coded values ( #143356 )
2026-01-02 15:42:04 +01:00
Jan-Eric Nitschke
8a2deea1fc
gh-128067: Fix pyrepl overriding printed output without newlines ( #138732 )
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2026-01-02 14:04:37 +01:00
Loïc Simon
c3febba73b
gh-140870: Full coverage for _pyrepl._module_completer ( #143244 )
...
Full coverage for _pyrepl._module_completer
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-12-28 20:06:06 +01:00
Brett Cannon
af185727b2
GH-65961: Stop setting __cached__ on modules (GH-142165)
2025-12-11 11:44:46 -08:00
Bartosz Sławecki
06c779474c
gh-137568: Ignore startup file in test_dumb_terminal_exits_cleanly (GH-140295)
2025-10-26 10:48:03 -04:00
DeepWzh
81959a0364
gh-133400: Fixed Ctrl+D (^D) behavior in :mod:_pyrepl module (GH-133883)
...
Co-authored-by: adam j hartz <adam@smatz.net>
2025-10-09 16:16:48 +02:00
Loïc Simon
537133d2b6
gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) (GH-138268)
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-09-15 18:51:34 +02:00
Sam Gross
98d462cf4d
gh-137179: Fix flaky test_history_survive_crash test (gh-137180)
...
Kill the REPL subprocess once it prints the output from the command
immediately before the `time.sleep()`.
2025-07-29 14:25:50 -04:00
Łukasz Langa
09dfb50f1b
gh-135621: Remove dependency on curses from PyREPL (GH-136758)
2025-07-21 11:57:34 +02:00
Richard Si
be02e68158
gh-72327: Suggest using system terminal for pip install in PyREPL ( #136328 )
...
Users new to Python packaging often try to use pip from the REPL only to
be met with a confusing SyntaxError. If this happens, guide the user to
use a system terminal instead to invoke pip.
Closes #72327
---------
Co-authored-by: Tom Viner <tom@viner.tv>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2025-07-15 14:25:07 +00:00
devdanzin
baccfdb3d4
gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001)
2025-06-02 13:04:59 +02:00
Loïc Simon
0e3bc962c6
gh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181)
...
Co-authored-by: Loïc Simon <loic.simon@napta.io>
2025-05-26 01:05:08 +02:00
Yuichiro Tachibana (Tsuchiya)
b1b8962443
gh-127960 Fix the REPL to set the correct namespace by setting the correct __main__ module (gh-134275)
...
The `__main__` module imported in the `_pyrepl` module points to the `_pyrepl` module itself when the interpreter was launched without `-m` option and didn't execute a module,
while it's an unexpected behavior that `__main__` can be `_pyrepl` and relative imports such as `from . import *` works based on the `_pyrepl` module.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-22 02:18:00 +02:00
Kevin Hernández
a3a3cf6d15
gh-134215: PyREPL: Do not show underscored modules by default during autocompletion (gh-134267)
...
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 22:26:48 +02:00
Tom Wang
8421b03b16
gh-134235: Import Autocomplete for Builtin Modules (GH-134277)
...
* added enhancement auto completing import with sys builtins
---------
Co-authored-by: Hunter <hyoung3@gmail.com>
2025-05-19 14:21:30 -07:00
Jessica Temporal
faebf87b37
gh-134214: Fix test case in pyrepl (gh-134223)
2025-05-19 16:26:04 +02:00
Kirill Podoprigora
c31547a591
gh-134097: Print number of refs & blocks after each statement in new REPL (gh-134136)
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 15:30:43 +02:00
Tan Long
4617d68d73
gh-133639: Fix test_auto_indent_default() doesn't run input_code ( #133640 )
2025-05-08 09:24:19 +01:00
Łukasz Langa
fac41f56d4
gh-131507: Add support for syntax highlighting in PyREPL (GH-133247)
...
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-02 20:22:31 +02:00
sobolevn
b739ec5ab7
gh-133054: Skip test_pyrepl tests when cannot use pyrepl is reported ( #133055 )
...
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-28 19:09:28 +03:00
Sergey B Kirpichev
276252565c
gh-127495: Append to history file after every statement in PyREPL (GH-132294)
2025-04-27 15:32:37 +02:00
Tomas R.
c3a7118065
gh-69605: Add module autocomplete to PyREPL ( #129329 )
2025-04-25 02:24:26 +01:00
Bénédikt Tran
492e3e6976
gh-129098: avoid using content of _pyrepl/__main__.py when reporting tracebacks ( #130721 )
2025-04-20 18:24:30 +01:00
Łukasz Langa
5d8e981c84
gh-131507: Clean up tests and type checking for _pyrepl ( #131509 )
2025-03-21 15:48:10 +01:00
R. David Murray
a09c2b2ba6
Fix test_pyrepl.TestDumbTerminal if PYTHON_BASIC_REPL set. ( #131332 )
...
Most of the tests that care already adjust PYTHON_BASIC_REPL as needed,
but this one doesn't, and it fails if the developer has the variable set.
2025-03-17 18:56:21 +01:00
Thomas Grainger
24c84d816f
gh-128770: fix ResourceWarning in test_pyrepl ( #128906 )
2025-01-22 12:48:33 +00:00
Daniel Hollas
29caec62ee
gh-118878: Pyrepl: show completions menu below the current line ( #118939 )
...
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-01-21 21:06:13 +00:00
Lysandros Nikolaou
5a9afe2362
gh-123024: Correctly prepare/restore around help and show-history commands ( #124485 )
...
Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-01-21 21:04:30 +00:00
Hugo van Kemenade
05d12eecbd
gh-127873: Only check sys.flags.ignore_environment for PYTHON* env vars ( #127877 )
2025-01-21 16:10:08 +00:00
Hugo van Kemenade
76856ae165
Revert "gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings ( #128726 )" ( #128936 )
2025-01-17 15:16:10 +02:00
Thomas Grainger
7807b40730
gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings ( #128726 )
...
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Brett Cannon <brett@python.org>
2025-01-17 13:39:16 +02:00
devdanzin
44becb8cba
gh-125666: Avoid PyREPL exiting when a null byte is in input ( #125732 )
2024-10-27 01:23:53 +00:00
Victor Stinner
65ce228d63
gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL ( #125097 )
...
If the PYTHON_BASIC_REPL environment variable is set, the site module
no longer imports the _pyrepl module.
Moreover, the site module now respects -E and -I command line
options: ignore PYTHON_BASIC_REPL in this case.
2024-10-08 15:48:40 +02:00
Jelle Zijlstra
365dffbaad
gh-119180: No longer set __annotations__ in __main__ ( #124634 )
2024-09-27 05:49:43 -07:00
Emily Morehouse
c1600c78e4
gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search ( #124396 )
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-09-25 20:22:03 +02:00
aorcajo
e95984826e
gh-119310: Fix encoding when reading old history file ( #121779 )
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-09-06 15:40:29 +02:00
Victor Stinner
8311b11800
gh-119034, REPL: Change page up/down keys to search in history ( #123607 )
...
Change <page up> and <page down> keys of the Python REPL to history
search forward/backward.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-09-06 13:15:00 +02:00
Arnon Yaari
d683f49a7b
gh-111201: fix auto-indent in pyrepl for muliple pound comments ( #123196 )
2024-09-06 07:33:40 +00:00
CF Bolz-Tereick
aa905925e1
gh-123228: don't leak file descriptors in pyrepl test ( #123302 )
2024-08-25 15:52:51 +01:00