summaryrefslogtreecommitdiffstats
path: root/zellij-server/src/ui
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-07-08 17:19:42 +0200
committerGitHub <noreply@github.com>2022-07-08 17:19:42 +0200
commitc89b416d764d80a72130821506f36157a08321e9 (patch)
tree6d1cc2d7fd5fddbb33fcbff192153700a9788bec /zellij-server/src/ui
parent61deca80edb1632eb8ca22f627c6001b757021dc (diff)
feat(terminal): sixel support (#1557)
* work * work * work * work * work * more work * work * work * work * hack around stdin repeater * refactor(sixel): rename sixel structs * feat(sixel): render text above images * fix(sixel): reap images once they're past the end of the scrollbuffer * fix(sixel): display images in the middle of the line * fix(sixel): render crash * fix(sixel): react to SIGWINCH * fix(sixel): behave properly in alternate screen mode * fix(sixel): reap images on terminal reset * feat(sixel): handle DECSDM * fix(terminal): properly respond to XTSMGRAPHICS and device attributes with Sixel * Add comment * fix(sixel): hack for unknown event overflow until we fix the api * feat(input): query terminal for all OSC 4 colors and respond to them in a buggy way * fix(sixel): do not render corrupted image * feat(input): improve STDIN queries * fix(client): mistake in clear terminal attributes string * fix(ansi): report correct number of supported color registers * fix(sixel): reap images that are completely covered * style(comment): fix name * test(sixel): infra * test(sixel): cases and fixes * fix(sixel): forward dcs bytes to sixel parser * refactor(client): ansi stdin parser * refactor(output): cleanup * some refactorings * fix test * refactor(grid): sixel-grid / sixel-image-store * refactor(grid): grid debug method * refactor(grid): move various logic to sixel.rs * refactor(grid): remove unused methods * fix(sixel): work with multiple users * refactor(pane): remove unused z_index * style(fmt): prepend unused variable * style(fmt): rustfmt * fix(tests): various apis * chore(dependencies): use published version of sixel crates * style(fmt): rustfmt * style(fmt): rustfmt * style(lint): make clippy happy * style(lint): make clippy happy... again * style(lint): make clippy happy... again (chapter 2) * style(comment): remove unused * fix(colors): export COLORTERM and respond to XTVERSION * fix(test): color register count * fix(stdin): adjust STDIN sleep times
Diffstat (limited to 'zellij-server/src/ui')
-rw-r--r--zellij-server/src/ui/pane_contents_and_ui.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/zellij-server/src/ui/pane_contents_and_ui.rs b/zellij-server/src/ui/pane_contents_and_ui.rs
index 50f763167..b0eae8e82 100644
--- a/zellij-server/src/ui/pane_contents_and_ui.rs
+++ b/zellij-server/src/ui/pane_contents_and_ui.rs
@@ -44,13 +44,19 @@ impl<'a> PaneContentsAndUi<'a> {
&mut self,
clients: impl Iterator<Item = ClientId>,
) {
- if let Some((character_chunks, raw_vte_output)) = self.pane.render(None) {
+ if let Some((character_chunks, raw_vte_output, sixel_image_chunks)) = self.pane.render(None)
+ {
let clients: Vec<ClientId> = clients.collect();
self.output.add_character_chunks_to_multiple_clients(
character_chunks,
clients.iter().copied(),
self.z_index,
);
+ self.output.add_sixel_image_chunks_to_multiple_clients(
+ sixel_image_chunks,
+ clients.iter().copied(),
+ self.z_index,
+ );
if let Some(raw_vte_output) = raw_vte_output {
self.output.add_post_vte_instruction_to_multiple_clients(
clients.iter().copied(),
@@ -65,9 +71,16 @@ impl<'a> PaneContentsAndUi<'a> {
}
}
pub fn render_pane_contents_for_client(&mut self, client_id: ClientId) {
- if let Some((character_chunks, raw_vte_output)) = self.pane.render(Some(client_id)) {
+ if let Some((character_chunks, raw_vte_output, sixel_image_chunks)) =
+ self.pane.render(Some(client_id))
+ {
self.output
.add_character_chunks_to_client(client_id, character_chunks, self.z_index);
+ self.output.add_sixel_image_chunks_to_client(
+ client_id,
+ sixel_image_chunks,
+ self.z_index,
+ );
if let Some(raw_vte_output) = raw_vte_output {
self.output.add_post_vte_instruction_to_client(
client_id,