Giter Club home page Giter Club logo

Comments (14)

Stebalien avatar Stebalien commented on June 1, 2024

I'm not calling an external binary on any platform. Currently, the best solution is to set the TERMINFO environment variable (see the README). I'm also considering pre-parsing some terminfo databases and including them in term.

from term.

Diggsey avatar Diggsey commented on June 1, 2024

I don't consider requiring manual intervention by the end-user to be a solution, let alone the best solution.

If you are averse to running an external binary, there are a number of other ways to get cygroot:

  • Call the path conversion function directly from msys-2.0.dll/cygwin1.dll
  • Use one of the environment variables, for example you can easily figure out the root directory from %HOME%, which will be C:\msys64\home\<username>
  • Use the %CYGROOT%/%MSYSROOT% environment variables, falling back to C:\msys64 or C:\cygwin if they don't exist. (This is probably the best option)

Having some common terminfo's built-in would be a good fallback.

from term.

Stebalien avatar Stebalien commented on June 1, 2024

I didn't know about %CYGROOT%/%MSYSROOT%. I'll look into using those.

from term.

Diggsey avatar Diggsey commented on June 1, 2024

The problem is that they're not set by the official installer - they're set if you install through some alternative ways, such as via chocolatey, so if you installed to a custom directory that's not C:\msys64, you'd have to set them manually.

from term.

Stebalien avatar Stebalien commented on June 1, 2024

Link for future reference: https://cygwin.com/cygwin-api/func-cygwin-conv-path.html

Dynamically loading cygwin1.dll/msys-2.0.dll might be the way to go. Do you know how one finds DLLs on windows?

from term.

Diggsey avatar Diggsey commented on June 1, 2024

You shouldn't need to find them - if the program is run from an msys or cygwin shell then they'll be on the PATH already.

from term.

Stebalien avatar Stebalien commented on June 1, 2024

Got it. I didn't realize Windows allowed dynamically loading libraries from the PATH at runtime (libraries like libloading expect a full path).

from term.

retep998 avatar retep998 commented on June 1, 2024

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx#search_order_for_desktop_applications

from term.

Geobert avatar Geobert commented on June 1, 2024

Hi there!

Bumped into this from the intelliJ rust plugin, any progress on this?

Cheers!

from term.

Stebalien avatar Stebalien commented on June 1, 2024

Unfortunately, not really; I don't really have time to learn low-level Windows stuff at the moment. term now has decent support for fallback terminals when $TERM is known but the terminfo database can't be found (so coloring should work) but that's it.

from term.

matklad avatar matklad commented on June 1, 2024

Actually, Cargo recently migrated to termcolor: rust-lang/cargo#4162. So it soon should emit pure ANSI codes for windows, and that in theory should just work with IntelliJ.

from term.

Stebalien avatar Stebalien commented on June 1, 2024

Isn't this more about rustc error messages than cargo?

from term.

matklad avatar matklad commented on June 1, 2024

Hm, @Stebalien you are probably right! I wonder if it is desirable to remove terminfo parsing from rustc as well...

from term.

Stebalien avatar Stebalien commented on June 1, 2024

Given fallback terminals, removing terminfo parsing shouldn't be an issue (although that create has a much nicer interface than this one...).

Actually, IMO, the terminfo parser is the one part of this crate that's really worth saving. The pretty-printing API is not fun to use.

from term.

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.