jupyter / qtconsole

Jupyter Qt Console
https://qtconsole.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
418 stars 201 forks source link

ANSI escape sequences other than color #350

Closed mdietrich16 closed 2 weeks ago

mdietrich16 commented 5 years ago

I am using the jupyter qtconsole through spyder, but I have tested the following in a standalone console aswell.

I know that certain ANSI escape sequences are being parsed, like simple colors and TrueColors, but is it possible to use stuff like '\027[A' (cursor up) or implement it myself?

I'm not very profound in stuff like this, but if I could get a little nudge in the right direction I might be able to at least help myself if it is not overly complicated and hard to pull off.

Oh, and I saw that line 27 in ansi_code_processor.py actually says # FIXME: Not implemented in AnsiCodeProcessor.

So do you just need people or good ideas, because I would happy to fix the first :)

ccordoba12 commented 5 years ago

We need people, so you're more than welcome to help us to improve this.

wmvanvliet commented 5 years ago

PRs are always welcome!

mdietrich16 commented 5 years ago

Well, seeing that I have never worked with the intrinsics of this project, I would need some pointer as to what and where to look to try to improve this, as I said. But other than the first steps, happy to help!

sylvain-bougnoux commented 3 years ago

Yes, same for erase line, eg: print('Hello','\x1b[2K\rBye') Should print 'Bye' and not 'Byelo'. It does work on a windows terminal (both with python & ipython).

ma-sadeghi commented 2 years ago

Can I ask what's the status of this issue? Is it hard to fix?

ccordoba12 commented 2 years ago

It shouldn't be too hard to fix, we just haven't had time to sit down and do it.

ma-sadeghi commented 2 years ago

Could you please give me some pointers so I can take a crack at it? I don't know where to start.

ccordoba12 commented 2 years ago

Our ANSI processor is implemented here:

https://github.com/jupyter/qtconsole/blob/master/qtconsole/ansi_code_processor.py