selectel / pyte

Simple VTXXX-compatible linux terminal emulator
http://pyte.readthedocs.org/
GNU Lesser General Public License v3.0
658 stars 102 forks source link

allow custom handler for specific escaped sequence? #94

Open randy3k opened 7 years ago

randy3k commented 7 years ago

Right now, the handlers for OSC sequences are hardcoded and it doesn't support other codes other than 01 and 02. Is there any chance to allow user to specific a handler if a certain sequence is observed. One of such use cases is to detect the sequence

ESC ] 1337 ; File = [optional arguments] : base-64 encoded file contents ^G

which is used in imgcat to display images. It will allow applications to show images in their terminals.

superbobry commented 7 years ago

Hi Randy, yep, this is something I'd like to do. Ideally, pyte should have a dict mapping OSC commands to Screen slots, similar to how it is done for other ESC sequences.