GithubHelp home page GithubHelp logo

euporie-console not working about euporie HOT 6 CLOSED

mukund109 avatar mukund109 commented on July 29, 2024
euporie-console not working

from euporie.

Comments (6)

joouha avatar joouha commented on July 29, 2024 1

Currently I run all the terminal queries before any output is generated, so should be OK on the first point.

The line wrapping I hadn't thought of, but will ensure it's disabled before probing the terminal (currently it gets disabled afterwards).

Thanks so much for your help!

from euporie.

joouha avatar joouha commented on July 29, 2024

Which version of GNOME Terminal are you using? I've just tested on GNOME Terminal 3.44.1, and it works as expected.

The text you're seeing before the prompt is an escape sequence for detecting kitty terminal graphics support, and it shouldn't be printed to the terminal - but I have seen some old VTE base terminals print it.

Do you get the same thing in other terminals? Does the cursor move if you try to type something?

from euporie.

jerch avatar jerch commented on July 29, 2024

@joouha Proper fingerprinting of the kitty image support is quite tricky, mainly because it relies on APC escape sequences, which are lousy to not supported by several terminals (resp. their parsers). Most of those "defect" terminals would just print things to the output, thus you might get away by doing a CPR afterwards and fixing cursor moves and falsey output manually.

from euporie.

joouha avatar joouha commented on July 29, 2024

Thanks @jerch - I've done some playing around, and found that sending the following sequences works quite well:

  • Save cursor position (\x1b[s)
  • Kitty detection APC (\x1b_Gi=4294967295,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\)
  • Restore cursor position (\x1b[u)
  • Erase line right (\x1b[2K)

This leaves the cursor in it's original position and leaves no trace of the APC code.

@mukund109, I've implemented this in v2.0.6 - I'd appreciate it if you could test this and let me know if that fixes the issue for you.

Thanks!

from euporie.

jerch avatar jerch commented on July 29, 2024

@joouha Yep good idea with the cursor saving. I only see 2 minor issues linked to the whole idea (prolly not showstoppers):

  • The test should run on a "clean slate" terminal, prolly very early after switching to alternate buffer (assuming euporie does not use the normal scrolling buffer). This way it cannot destroy accidentally previous terminal buffer content on falsey printing to right side. If done late (right before first image usage), the cursor might be in the middle of already written terminal cells destroying important output. Not sure to what degree you control the screen state internally and can easily restore from those screen hazards.
  • Current cursor position minus COLS should be wide enough to hold a falsey printout from the test sequence (39 cells if counted correctly), otherwise your line erasing wont reset all rubbish (as the terminal already might have advanced to the next line, ehm if DECAWM is set - geez so many ifs and elses...). Again if you have quite advanced control of the screen state this might not be an issue at all for euporie.

from euporie.

joouha avatar joouha commented on July 29, 2024

I think this is fixed now, please open a new issue if you're still experiencing problems with euporie-console

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.