Comments (4)
This isn't possible to add support for with the current UI library that WeeChat uses, ncurses. It handles all text printing to the terminal and doesn't have a way to include an escape character in a text string. The reason for that is that it needs to understand the escape sequences in order to do text wrapping, side panels etc. If it would have been possible you would encounter issues such as color/links bleeding into the nicklist (when you have it on the right side as default).
It is possible to send escape sequences directly to the terminal, separately from any text in the UI though. This means you can't use it for colors or links, as the text for that would just appear where the cursor is, independently of any UI elements or the buffer you're in, and cleared when the UI is redrawn. But it can be used to e.g. send escape sequences for desktop notifications or with some limitations show images (either on top of the UI independently of it, or in the UI by using unicode placeholders).
To send escape sequences directly to the terminal, just write directly to /dev/tty
.
Here's an example in bash: https://gist.github.com/trygveaa/e304621f53c62c792864faeedfddb86b
And here's an example in a WeeChat Python script: https://github.com/trygveaa/weechat-icat/blob/ece458c6c17c00dab6fe5a7a4fc57c204d7a72b5/weechat_icat/terminal_graphics.py#L237-L240
from weechat.
Ooh, I see, it seems like I did not quite realise what exactly the limitation was with ncurses, thanks for the detailed explanation.
Looks like best I could do atm is to coarse the #rrggbb into the 256-color palette, oh well
from weechat.
Looks like best I could do atm is to coarse the #rrggbb into the 256-color palette, oh well
WeeChat already has a function for this btw. color_rgb2term
in info_get.
from weechat.
Oh, calling that is.. significantly less code than what I've cooked up (that's code for "stole from tmux") already, thanks again :)
from weechat.
Related Issues (20)
- memory leak after using a huge argument list to a command HOT 8
- /amsg and /ame also send in parted channels HOT 1
- add tags in buffer created with /exec -nf
- the hook_line always print a line even if there is no content HOT 1
- removing a line in a hook_line differ between free and formatted buffer HOT 1
- For many IRC signals, ${nick} is the server domain instead of the nick HOT 2
- Reusing a xfer chat buffer after an /upgrade breaks the buffer
- /input search_stop always scrolls to the bottom
- add an addreplace to all commands that have an add
- IRCv3 server-time messages delivered out of order are appended to the buffer which breaks IRC as a p2p protocol HOT 2
- Convert option weechat.look.hotlist_sort to a list of hdata fields
- API function to update hotlist for a buffer with direct values
- Support for more notify levels
- Behaviors search_text and search_text_here the same? HOT 1
- Expose setting custom FIFO path as CLI argument for convenience HOT 1
- Why does my custom buflist.format.buffer not respect color changes by weechat? HOT 1
- different syntax between mouse and cursor mode to specify all keys
- Error decoding websocket frame for client (API relay)
- account-notify causes /who spam in server buffer
- ruby: (some) builtin functions not available with ruby 3.3 HOT 4
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 weechat.