Terminal emulator widget for prompt_toolkit applications.
Clone or download
BoboTiG and jonathanslenders Fix ResourceWarning: unclosed file in setup.py
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
Latest commit e104399 Jan 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples First ptterm version. Jun 19, 2018
ptterm Improved process termination methods. Jun 22, 2018
LICENSE Initial commit. Apr 12, 2017
README.rst Added README.rst Jul 22, 2018
setup.py Fix ResourceWarning: unclosed file in setup.py Jan 7, 2019

README.rst

ptterm

A terminal emulator widget for prompt_toolkit applications

Features

  • Cross platform: Windows + Linux support.

Applications using ptterm

  • pymux: A terminal multiplexer, written in Python.

Example

Inserting the terminal into a prompt_toolkit application is as easy as importing a Terminal and inserting it into the layout. You can pass a done_callback to get notified when the terminal process is done.

#!/usr/bin/env python
from prompt_toolkit.application import Application
from prompt_toolkit.layout import Layout
from ptterm import Terminal


def main():
    def done():
        application.exit()

    application = Application(
        layout=Layout(
            container=Terminal(done_callback=done)
        ),
        full_screen=True,
    )
    application.run()


if __name__ == '__main__':
    main()

Thanks