python / cpython

The Python programming language
https://www.python.org
Other
63.55k stars 30.45k forks source link

Support Windows pseudoterminals in pty and termios modules #85829

Open 4549a0a9-1341-4be9-ace1-405a34e96146 opened 4 years ago

4549a0a9-1341-4be9-ace1-405a34e96146 commented 4 years ago
BPO 41663
Nosy @zooba, @pradyunsg, @cs01

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['type-feature', 'library', '3.10'] title = 'Support Windows pseudoterminals in pty and termios modules' updated_at = user = 'https://github.com/cs01' ``` bugs.python.org fields: ```python activity = actor = 'pradyunsg' assignee = 'none' closed = False closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'cs01' dependencies = [] files = [] hgrepos = [] issue_num = 41663 keywords = [] message_count = 2.0 messages = ['376071', '405911'] nosy_count = 3.0 nosy_names = ['steve.dower', 'pradyunsg', 'cs01'] pr_nums = [] priority = 'normal' resolution = None stage = 'test needed' status = 'open' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue41663' versions = ['Python 3.10'] ```

4549a0a9-1341-4be9-ace1-405a34e96146 commented 4 years ago

The pty and termios modules do not support Windows. Current Python pty documentation suggest Windows might be supported:

The Linux code is supposed to work on other platforms, but hasn’t been tested yet.

but I have confirmed that it is not while adding pty usage to gdbgui.

The new Windows Psuedo Console, ConPTY, available in Windows 10, now makes this possible.

Proof of existence of a common pty interface for all platforms exists for node with the node-pty npm package, which uses ConPTY.

References:

pradyunsg commented 3 years ago

https://github.com/spyder-ide/pywinpty might be relevant; although it's implemented in Rust.

dennisvang commented 6 months ago

related to #85323