Git Product home page Git Product logo

Comments (3)

joouha avatar joouha commented on September 22, 2024

Hello,

That sounds like a pretty cool workflow!

You'll need to use bracketed paste to get this working:

  1. Send \cc to clear euporie's input box before sending anything
  2. Send \x1b[200~ before your code;
  3. Send your code;
  4. Send \x1b[201~ after your code;
  5. Send \x1b[13;5u to run the code (Ctrl-Enter).

\x1b[13;5u will always run whatever is entered, whereas \r will only run what is entered if it passes the kernel's code-completeness check.

For example:

kitty @ send-text --all --exclude-active '\cc\x1b[200~print(123)\nprint(456)\x1b[201~\x1b[13;5u'

image

I hope that you get it working!

from euporie.

IndianBoy42 avatar IndianBoy42 commented on September 22, 2024

Thanks for the tip about bracketed paste! that works great.

You seem pretty knowledgeable so can I ask, is there a good utility/library for converting keypresses into those csi/escape codes? or somewhere to learn all the details necessary to make one myself?

from euporie.

joouha avatar joouha commented on September 22, 2024

The VT100 user guide always makes a nice bit of light reading:
https://vt100.net/docs/vt100-ug/chapter3.html#S3.3

There's also a wikipedia page on control-codes which might be a bit more accessible:
https://en.wikipedia.org/wiki/C0_and_C1_control_codes

You might want to read the wikipedia page on ansi escape sequences first for a bit of background:
https://en.wikipedia.org/wiki/ANSI_escape_code#Fe_Escape_sequences

Here's a couple of pages on modern terminal keyboard input:
http://www.leonerd.org.uk/hacks/fixterms/
https://sw.kovidgoyal.net/kitty/keyboard-protocol/

If you run stty raw -echo; cat -v, your terminal will print escaped key-press escape sequences.

from euporie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.