analitics

Pages

Monday, February 9, 2026

Python 3.13.0 : New Feature: Interactive History Search.

If you are using the new Python 3.13 REPL, you might have noticed a new prompt when pressing certain keys. This is the upgraded interactive shell that now supports built-in history searching.
What is f-search and r-search?
These features allow you to search through every command you have previously typed without using the arrow keys.
How to trigger it:
- Press Ctrl + R to initiate a Reverse Search. You will see (r-search ''). This looks through your history from newest to oldest.
- Press Ctrl + S to initiate a Forward Search. You will see (f-search ''). This looks through your history from oldest to newest.
How to use it:
1. Type the shortcut (Ctrl+R or Ctrl+S).
2. Start typing any part of a previous command (e.g., 'import' or 'def').
3. The shell will automatically complete the line with the best match.
4. Press Enter to run the command, or use the arrow keys to start editing the found line.
5. If you want to cancel the search, simply press Ctrl + G.
This feature makes the Python 3.13 terminal feel much more like a modern shell, saving time and reducing repetitive typing.
C:\Python313_64bit>python
Python 3.13.0 (tags/v3.13.0:60403a5, Oct  7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import sys
(r-search `os') import os