Comments (10)
Thanks for the report!
How are you writing to stdout? Are you creating a new uv_tty_t and writing
to that or just calling lua's native print or io interface? (You can simply
post your lua if you want). Also how did you build for windows. I
haven't yet tried it. I get back home on Saturday night and can test on
windows next Monday.
On Thu, Oct 9, 2014 at 9:38 PM, George Zhao [email protected]
wrote:
tty not work on windows,(on version
https://github.com/luvit/luv/tree/uv-update-1.0.0)
output is[0;34m1[0m [0;35muv_tcp_t: 0x000e8fe8[0m
[1;32m"[0;32mserver[1;32m"[0m [0;35muv_tcp_t: 0x000e8fe8[0m { ip =
[1;32m"[0;32m0.0.0.0[1;32m"[0m, family = [1;32m"[0;32mINET[1;32m"[0m, por
t = [0;34m2024[0m }—
Reply to this email directly or view it on GitHub
#74.
from luv.
I just run luajit test/run.lua
from luv.
Ok, then it's my fault. I'm using the native print and sending unix color
escape codes manually in utils.lua. Libuv will convert these to proper
windows codes if you write through uv_tty_t. I'll update the samples and
tests to re-define print to go through libuv.
On Thu, Oct 9, 2014 at 9:42 PM, George Zhao [email protected]
wrote:
I just run luajit test/run.lua
—
Reply to this email directly or view it on GitHub
#74 (comment).
from luv.
Please do not translate them in libuv. When we want to pass binary data through tty stdio, that might causes problems. On Windows, there are some winapis such as SetConsoleTextAttribute to change colors, but not codes. So we should implement another library or use luajit ffi to filter escaping codes on Windows.
from luv.
That sounds reasonable. Turning off color output on windows and not changing anything else seems like a good fix for now.
from luv.
I won't be the one doing the translation. It's a feature of libuv which I'm binding. It's up to the lua code to use libuv tty for output or using lua's built-in IO functions.
from luv.
On Windows, we must filter the escape code self and change the color by calling the specified WINAPI. Both lua io library and libuv donot provide translating. @creationix please keep in mind Windows does not control the tty by escape codes.
from luv.
@imzyxwvu I'm well aware that windows does not know anything about ansi escape codes. Like I said before, this is a feature of libuv that many people find useful. The code can be found in https://github.com/joyent/libuv/blob/master/src/win/tty.c. Luv knows nothing about this but simply inherits the ability from libuv itself.
I know this feature works. I've used it in the past on node.js, luvit, and recently luvi on windows. Luvit redefines lua's print
global to go through libuv's tty so that ansi color codes work on windows.
from luv.
@zhaozg does this fix colors for you in the repl example on windows? 8af4408
from luv.
Work fine. thanks. but test/run.lua can't pass
from luv.
Related Issues (20)
- clean stale, unused branches HOT 2
- Frequent segfaults in `push_fs_result` HOT 16
- request bind v1.45.0 new features HOT 13
- Change `get_constrained_memory` binding to return `nil` instead of `0`
- `cpu_info` binding might not handle `model` correctly HOT 2
- Release 1.45.0 checklist. HOT 1
- Add `fs_access` test(s)
- request bind v1.46.0 new features
- fs_scandir_next() sometimes returns name but no type HOT 6
- track issues in neovim related with luv HOT 4
- CI failing for LuaJIT v2.1 branch
- process creation segfault HOT 2
- How to pass command line string to uv.spawn? HOT 4
- Do I have to use `uv.run()` to wait async reading file with `fs_read` API? HOT 2
- Question: Is `shutdown` and `close` (use new_pipe with spawn) sync or async? HOT 1
- Question: the arrival order of uv.spawn `on_exit` and `data == nil` in `read_start` callback on Windows 10? HOT 2
- Why udp_recv_start callback call twice? HOT 2
- `tty normal` normal tests fails for me on Fedora mockbuild HOT 4
- Error loading module luv HOT 3
- Unable to send handles with uv_write2
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 luv.