mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-14 18:57:59 +01:00
Upgrade avt to the latest version / handle term resize explicitly
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -180,9 +180,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
|
||||
[[package]]
|
||||
name = "avt"
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b485f400d02970694eed10e7080f994ad82eaf56a867d6671af5d5e184ed8ee6"
|
||||
checksum = "2c72d2ab21480152ba01b79bf3f00197936314b780e21b9ef6f92ee1210c75ce"
|
||||
dependencies = [
|
||||
"rgb",
|
||||
"unicode-width",
|
||||
|
||||
@@ -28,7 +28,7 @@ config = { version = "0.14.0", default-features = false, features = ["toml", "in
|
||||
which = "6.0.0"
|
||||
tempfile = "3.9.0"
|
||||
scraper = { version = "0.19.0", default-features = false }
|
||||
avt = "0.14.0"
|
||||
avt = "0.15.0"
|
||||
axum = { version = "0.7.7", default-features = false, features = ["http1", "ws"] }
|
||||
tokio = { version = "1.35.1", features = ["full"] }
|
||||
futures-util = "0.3.30"
|
||||
|
||||
2
assets/asciinema-player.min.js
vendored
2
assets/asciinema-player.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -15,7 +15,6 @@ impl super::Encoder for TextEncoder {
|
||||
fn header(&mut self, header: &Header) -> Vec<u8> {
|
||||
let vt = avt::Vt::builder()
|
||||
.size(header.cols as usize, header.rows as usize)
|
||||
.resizable(true)
|
||||
.scrollback_limit(100)
|
||||
.build();
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ impl Session {
|
||||
|
||||
pub fn resize(&mut self, time: u64, tty_size: tty::TtySize) {
|
||||
if tty_size != self.vt.size().into() {
|
||||
resize_vt(&mut self.vt, &tty_size);
|
||||
self.vt.resize(tty_size.0.into(), tty_size.1.into());
|
||||
let _ = self.broadcast_tx.send(Event::Resize(time, tty_size));
|
||||
self.stream_time = time;
|
||||
self.last_event_time = Instant::now();
|
||||
@@ -97,14 +97,9 @@ impl Session {
|
||||
fn build_vt(tty_size: tty::TtySize) -> avt::Vt {
|
||||
avt::Vt::builder()
|
||||
.size(tty_size.0 as usize, tty_size.1 as usize)
|
||||
.resizable(true)
|
||||
.build()
|
||||
}
|
||||
|
||||
fn resize_vt(vt: &mut avt::Vt, tty_size: &tty::TtySize) {
|
||||
vt.feed_str(&format!("\x1b[8;{};{}t", tty_size.1, tty_size.0));
|
||||
}
|
||||
|
||||
impl Client {
|
||||
pub fn accept(self, subscription: Subscription) {
|
||||
let _ = self.0.send(subscription);
|
||||
|
||||
Reference in New Issue
Block a user