Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Console color support #33

Closed
qiangxue opened this Issue Mar 25, 2013 · 16 comments

Comments

Projects
None yet
5 participants
Owner

qiangxue commented Mar 25, 2013

This is partially done: yii\helpers\ConsoleColor.
Remaining work:

  • rethink API
  • Grace fall back on unsupported terminals
  • implement wrappers in console/Controller
  • Test on most terminals
  • complete documentation
  • improve yii commands with color and other cute stuff
  • not add support for magic properties as global options (needed for color switch)

@ghost ghost assigned cebe Mar 25, 2013

Contributor

tonydspaniard commented May 5, 2013

Instead of ConsoleColor why is not called Console and make other utility functions to work with terminals? For example:

  • prompt
  • select
  • confirm
  • download
  • progress <-- to display download information for example
  • etc
Owner

qiangxue commented May 5, 2013

These suggestions sound good to me.

Contributor

Ragazzo commented May 5, 2013

afaik there is a very good solution for console in the Antonio's new boilerplates, even with daemon written on php, can we take console functionality from there? would be very useful.

Owner

cebe commented May 5, 2013

This was ment as you suggested, @tonydspaniard . The name color is very bad choice here :)

Owner

cebe commented May 5, 2013

Instead of color we should talk about using ANSI control codes.
The main problem to solve here is to make it work in every terminal and have a fallback.
We may have a switch to turn ANSI control codes on and off. It may be on by default on linux machines and off on windows, but would be even better if we could detect whether we are running in a terminal or not.

Contributor

tonydspaniard commented May 6, 2013

@cebe I agree... there is not really a good solution for its support on Windows (not as far as I know). Nevertheless, if we forced to do so, here is a good reference and easiest way to do it:

Owner

samdark commented May 6, 2013

@tonydspaniard that will work with windows XP and less + most of console wrappers such as ConEmu or ANSICON. I think it's enough if we'll like to these tools from the guide or API docs.

Contributor

tonydspaniard commented May 6, 2013

Proposed: #144

cebe added a commit that referenced this issue May 8, 2013

Refactoring Console commands
added method wrappers in console/Controller

issue #33
Owner

cebe commented May 8, 2013

@tonydspaniard thanks for you proposal so far, I have refactored it a bit.
I think it is cool to have wrappers in console/Controller that adds the magic of whether ansi support is enabled or not and also if the command runs interactive or not. The raw stuff will be in Console helper.
I'd like to hear your feedback on this.

Owner

cebe commented May 8, 2013

cebe added a commit that referenced this issue May 8, 2013

cebe added a commit that referenced this issue May 25, 2013

Next iteration on console commands
issue #33
- implemted getScreenSize for linux systems
- tiny adjustments and better naming for console color methods
- color switch in base Controller changed to magic property
- colorized Help command
Owner

cebe commented May 25, 2013

Implemented Console::getScreenSize() for linux. Would be cool if someone else could do it for windows, as I don't have a windows system here to test currently.

http://stackoverflow.com/a/7575044/1106908

Owner

samdark commented May 25, 2013

Implemented. Also fixed ANSI color support detection.

Owner

qiangxue commented Jul 21, 2013

What is the remaining work for this issue? I'm moving this out of alpha.

Contributor

Ragazzo commented Jul 21, 2013

autocomplete i think, @cebe was suggesting in separate issue this feature, i think it is related.

Owner

samdark commented Jul 21, 2013

@qiangxue there's ansiToHtml in ConsoleBase that looks far from being completed.

Owner

cebe commented Jul 22, 2013

will try to finalise it this week.

@cebe cebe referenced this issue Aug 12, 2013

Closed

Implement console color converters #746

3 of 5 tasks complete

@cebe cebe closed this in b96fd24 Aug 12, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment