harzu / iced_term Goto Github PK
View Code? Open in Web Editor NEWTerminal emulator widget powered by ICED framework and alacritty terminal backend.
License: MIT License
Terminal emulator widget powered by ICED framework and alacritty terminal backend.
License: MIT License
Hey, been trying to set the term view up but have been getting the error in the title. Coredump isn't helpful unfortunately, core rendering stuff and stacktrace im too dumb to decipher (pointers to memory in the binary im assuming, but idk how that would help in current situation), and RUST_BACKTRACE=full
doesnt show anything either. I'm pretty much following the examples, i create and store Term
in App
in new()
and pass reference to it from &self
to term_view()
in view()
, check for events in update()
, closing window on Shutdown
request, and doing the subscription thing as well.
My theory is that the Fd gets dropped unexpectedly at some point but I can't figure out why since judging by the code (at first glance at least) and types used to store the Fd, it shouldn't happen? Mb I'm blind and missing some crucial step required to keep the descriptor alive, but as i said before, semantically my logic for handling Term is identical to the examples.
I will say that I don't store settings in App
, but just generate them in separate function to immediately pass them to Term
constructor (I'm planning to make some customizable behavior for opening new terminals, so i wanna generalize it under one function), which will get returned from said external function upon initialization. But I don't think this would cause the issue right?
Does Rust stable/nightly matter? (I'm on nightly 2024-05-01). Also, in case it's useful, I'n on NixOS, using nix-cargo-integration flake template, with dependencies to run the application set up (checked before termview was added).
I thought that maybe it could've been alacritty crate that's at fault but I didn't find any issues regarding this error in their repo.
Thanks in advance!
winit and iced handle scrolling of macbook's trackpad by pixels instead of lines.
winit and iced have 2 different types of mouse wheel event
iced::mouse::Event::WheelScrolled { delta } => match delta {
ScrollDelta::Lines { x: _, y } => Event::Scrolled(self.id, y),
ScrollDelta::Pixels { x: _, y } => Event::Scrolled(self.id, y),
}
but widget handles ScrollDelta::Lines
and ScrollDelta::Pixels
the same, so scrolling will be faster than need on some devices like macbook's trackpad
Scrolling works based on lines delta on any devices
convert pixel count to lines count and provide it to backend as the same way as it is implemented in ScrollDelta::Lines
handler
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.