Comments (11)
Support for colored output has been finally added in 1.8.0. Closing the issue.
from script-commands.
Good one! We'll look into supporting a subset of colors.
from script-commands.
@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.
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.
Otherwise, MD output is supported
from script-commands.
@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 using
xterm
style - you can switch to linux format addingexport 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.
Otherwise, MD output is supported
How does this work?
from script-commands.
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.
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)";
from script-commands.
Thanks for reporting @BoyangMichael, we'll take a look into it
from script-commands.
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)
- allow recursive search in script directory HOT 1
- "Running script" continues indefinitely HOT 2
- My script commands is occasionally missing HOT 15
- I hope to set the default value and memory ability. HOT 2
- AppleScript missing icons HOT 1
- Can't stop script from running in the background HOT 5
- Script causes the dock to come into focus as if Finder was right-clicked HOT 5
- Integrating Automation workflows HOT 1
- audio-output-switch.template no longer works -- suggested changes below (verified on Intel MBP 16" running macOS Ventura 13.4.1) HOT 2
- default-browser-XXX scripts - Mac OS Sonoma HOT 4
- Toggle Natural Scrolling script does not work on Sonoma HOT 4
- Failing to start Raycast command scripts - MacOS Sonoma HOT 3
- Feature Request: Interactive mode HOT 4
- execute script via hotkey without opening raycast? HOT 1
- Disabling 'reopen windows' feature while using system restart command HOT 1
- Default browser scripts not working on Sonoma HOT 4
- commands/system/copy-availability.swift throws an error when run - "Symbols not found" HOT 2
- Clipboard content not getting set to the 1st Argument in Apple Music Search HOT 5
- [Feature request] Reusing argument with the same name in a QuickLink HOT 1
- Scripts in NodeJS: when explicitly exiting the process, the exit code is ignored by Raycast HOT 2
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 script-commands.