Skip to content

Commit

Permalink
Support resize messages in ALiS parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Aug 18, 2023
1 parent 4131600 commit 8291dcf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/asciinema/streaming/parser/alis.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ defmodule Asciinema.Streaming.Parser.Alis do
{:ok, [feed: {time, data}], state}
end

def parse(
{
<<
?r,
time::little-float-32,
cols::little-16,
rows::little-16
>>,
_opts
},
%{status: :online} = state
) do
{:ok, [resize: {time, {cols, rows}}], state}
end

def parse({<<0x04>>, _opts}, %{status: status} = state) when status in [:init, :online] do
{:ok, [status: :offline], %{state | status: :offline}}
end
Expand Down

0 comments on commit 8291dcf

Please sign in to comment.