Code Monkey home page Code Monkey logo

Comments (11)

PitNikola avatar PitNikola commented on May 19, 2024 6

Support for colored output has been finally added in 1.8.0. Closing the issue.

from script-commands.

thomaspaulmann avatar thomaspaulmann commented on May 19, 2024 4

Good one! We'll look into supporting a subset of colors.

from script-commands.

grzegorzkrukowski avatar grzegorzkrukowski commented on May 19, 2024 3

@BoyangMichael we currently support only limited subset of terminal codes. For now those are only 8 basic colours for foreground and background in linux format. We will extend supported range of terminal codes in future.

It seems you are usingxterm style - you can switch to linux format adding export TERM=linux on top of your script.
That will allow you to play around with foreground, background colours and fix the problem with reset [0m escape code.

from script-commands.

PitNikola avatar PitNikola commented on May 19, 2024 2

Just to clarify: Markdown output is not supported either (and will unlikely to be supported).
Colored output and link parsing is on our list of improvements.

from script-commands.

nbstoner avatar nbstoner commented on May 19, 2024 1

Otherwise, MD output is supported

from script-commands.

BoyangMichael avatar BoyangMichael commented on May 19, 2024 1

@BoyangMichael we currently support only limited subset of terminal codes. For now those are only 8-bit foreground and background colours in linux format. We will extend supported range of terminal codes in future.

It seems you are usingxterm style - you can switch to linux format adding export TERM=linux on top of your script.
That will allow you to play around with foreground, background colours and fix the problem with reset [0m escape code.

@grzegorzkrukowski Thanks a lot for the answer! It is very helpful! The problem is solved after switching from xterm to linux.

from script-commands.

jkelleyrtp avatar jkelleyrtp commented on May 19, 2024

Otherwise, MD output is supported

How does this work?

from script-commands.

nbstoner avatar nbstoner commented on May 19, 2024

Otherwise, MD output is supported

How does this work?

It may be out of essence. At present, some scripts command written by myself are expected to have some formats or colors on the output, the links can be opened by clicking, and some generated code fragments can be formatted and so on. (Well, this paragraph is translated by machine. I hope I can express my thoughts)

from script-commands.

BoyangMichael avatar BoyangMichael commented on May 19, 2024

Nice to have the colored output feature! However, there's still some issues that it does not distinguish between normal and dim. And the escape sequence generated by tput sgr0 does not seems to be interpreted correctly.

echo "Hello!"; echo "$(tput setaf 8)Hello!$(tput sgr0)"; echo "$(tput setaf 1)Hello!$(tput sgr0)";

Screen Shot 2021-02-19 at 11 35 58 AM

from script-commands.

PitNikola avatar PitNikola commented on May 19, 2024

Thanks for reporting @BoyangMichael, we'll take a look into it

from script-commands.

grzegorzkrukowski avatar grzegorzkrukowski commented on May 19, 2024

Updated Readme should now clarify the limitations of current implementation:
https://github.com/raycast/script-commands/blob/master/README.md#ansi-escape-codes---coloured-output

from script-commands.

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.