Comments (14)
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.
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 beC:\msys64\home\<username>
- Use the
%CYGROOT%
/%MSYSROOT%
environment variables, falling back toC:\msys64
orC:\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.
I didn't know about %CYGROOT%
/%MSYSROOT%
. I'll look into using those.
from term.
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.
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.
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.
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.
from term.
Hi there!
Bumped into this from the intelliJ rust plugin, any progress on this?
Cheers!
from term.
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.
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.
Isn't this more about rustc error messages than cargo?
from term.
Hm, @Stebalien you are probably right! I wonder if it is desirable to remove terminfo parsing from rustc as well...
from term.
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)
- Support parsing termcap HOT 11
- Check isatty == false before coloring HOT 11
- tag version v0.4.0? HOT 2
- How to fall back on std::io::stderr() if term::stderr() fails? HOT 8
- WinConsole's tty check is inaccurate HOT 1
- All Terminal methods leak memory on Windows HOT 7
- better support for multithreaded programs HOT 9
- Use `el` not `dl` to erase a line?
- How to store and pass around `Terminal` of any type. HOT 3
- `Terminal` should probably buffer
- panic with operation not supported by the terminal while libterm works fine HOT 3
- Term crashes on FreeBSD HOT 7
- No output to stdout when no TTY attached in Docker container HOT 2
- term::stdout() returns None unexpectedly HOT 3
- terminfo problem while using rogcat HOT 2
- Write plain text when running under a start/stop daemon like systemd ?
- [LFM] Looking For Maintainer HOT 11
- Last release was in February 2018 HOT 1
- Please relase a new version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from term.