Coder Social home page Coder Social logo

Comments (2)

tompng avatar tompng commented on August 18, 2024

The screenshot has some wierd parts.
Line 6 and 9 is showing that a is realy "€aaa". If so, IRB(not Reline) will just print "=> \e[31m\e[1m\"\e[0m\e[31m€aaa\e[0m\e[31m\e[1m\"\e[0m\n" to stdout in line 4. It does not depend on OS, terminal emulator, terminal size or other environment.

IRB::ColorPrinter.pp a="€aaa", output='', width=rand(100)
# => "\e[31m\e[1m\"\e[0m\e[31m€aaa\e[0m\e[31m\e[1m\"\e[0m\n"
# ColorPrinter does not use Reline::Unicode to calculate width.

But it actually showed "€aa".
If this is reline's bug, broken rendering or wrong cursor position should only appear in line 2, not on line 4.

This behavior indicates that character widths in windows is not font-dependent but color-dependent. It should be a text rendering bug of windows console.

from reline.

larskanis avatar larskanis commented on August 18, 2024

@tompng Thank you for verifying this issue!

I just retried the above inputs with the "NSimSun" font on RubyInstaller-3.2.0 and now it works! The "€" has the double size as other characters, but all following characters are properly printed and are not overwritten. Also cursor movements and inserts work correctly.

So either the newer ruby version has fixed this in some way, or a Windows update did it.

from reline.

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.