Comments (6)
@itowlson Oh please do go ahead with the ascii formatting. I think yes/no
is just fine. For now I like your idea to disable coloring in ascii mode. However, ideally we should turn it on again, if we can reliably detect a PowerShell terminal.
I've also opened another issue to track the coloring on PowerShell #6. Since I cannot investigate this, could you kindly look into this as well?
from rakkess.
You are raising two separate points.
-
Color output. This is disabled for non-terminals, e.g.
rakkess | cat
orrakkess > result.txt
do not produce colors. Also, PowerShell should (I can't check) not output colors, because this is determined at pkg/rakkess/util/printer.go:79 withfunc IsTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil }
PowerShell being not unix, should return false here.
So I think color output is fine and does not need work (you can prove me wrong if you have a PowerShell :) ) -
Ascii formatting. This is a good point. What do you think about a flag
--ascii
or--ascii-mode
so that granted/denied is printed asyes/no
or evengranted/denied
? pkg/rakkess/util/printer.go is where you would want to start.
from rakkess.
Good point - I am indeed mixing two things.
As you say, PowerShell does not support colour, but what I found was that rakkess still printed the escape codes - but they were rendered as codes and square brackets. I can retry tomorrow and post a screenshot if that would be useful. I think on Draft we gave up trying to be clever about this and just turned colours off on Windows!
Anyway you are right that these are two separate issues. I'd be interested in tackling ASCII output if you are okay with that. I suggest that ASCII formatting should automatically suppress colours, and I'd tentatively go with yes/no
. Other ideas are granted/denied
as you suggest, or allowed/denied
. Let me know if you have a preference, otherwise I'll try to get you a PR and we can iterate on it there! And thanks for the pointer on the printer.go
starting point.
from rakkess.
any idea what could cause encoding issues under WSL (Windows Linux Subsystem). that the first time, I have encoding issues with bash
from rakkess.
@lgmorand unfortunately no. IIUC, you are saying that other UTF encoded text prints correctly, right? If anyone knows, I bet @itowlson does.
Maybe open a separate issue so that other folks can find the bug.
from rakkess.
@corneliusweig exactly. it's def looks like an encoding issue but it seems a common, with not clear solution: microsoft/terminal#190
I don't use Windows Terminal but I don't believe in coincidences :)
from rakkess.
Related Issues (20)
- Documentation does not match plugin capabilities HOT 1
- Add support for json output HOT 2
- Dependabot can't resolve your Go dependency files
- More powerful resource matching (ERRO[0005] determine requested resource: no matches for ...) HOT 2
- Dependabot can't resolve your Go dependency files
- Apple M1 Support HOT 1
- [FEAT] Comparison for different users or service accounts HOT 4
- Rakkess displays extra lines with no resource name and no permissons HOT 9
- inconsistency between access-matrix and "oc who-can"
- Missing assets for v0.5.1 HOT 1
- Krew is not able to install latest v0.5.1 version HOT 1
- What is "n/a" means in result matrix
- Doesn't work with subresources?
- Add support for use verb HOT 4
- nothing is displayed for a service-account HOT 10
- Install failure via krew HOT 2
- Installation with Curl is failing "not in gzip format" HOT 2
- `rakkess version` is not printing version information HOT 1
- Rakkess gets very slow when latency goes up HOT 2
- 0.4.5 darwin archive is empty 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 rakkess.