term: normalize imports to wezterm-xxx rather than termwiz re-exports
This commit is contained in:
14 files changed
+63
-58
No files matched your search
Generated
+3
@@ -6996,7 +6996,10 @@ dependencies = [
|
||||
"unicode-normalization",
|
||||
"url",
|
||||
"wezterm-bidi",
|
||||
"wezterm-cell",
|
||||
"wezterm-dynamic",
|
||||
"wezterm-escape-parser",
|
||||
"wezterm-surface",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
+5
-2
@@ -11,7 +11,7 @@ keywords = ["terminal", "emulator", "vte"]
|
||||
readme = "README.md"
|
||||
|
||||
[features]
|
||||
use_serde = ["termwiz/use_serde"]
|
||||
use_serde = ["termwiz/use_serde", "wezterm-cell/use_serde", "wezterm-escape-parser/use_serde", "wezterm-surface/use_serde"]
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
@@ -33,7 +33,10 @@ terminfo.workspace = true
|
||||
unicode-normalization.workspace = true
|
||||
url.workspace = true
|
||||
wezterm-bidi.workspace = true
|
||||
wezterm-dynamic.workspace = true
|
||||
wezterm-dynamic = {workspace = true, features=["std"]}
|
||||
wezterm-cell = {workspace = true, features=["std", "use_image"]}
|
||||
wezterm-escape-parser = {workspace = true, features=["std", "use_image"]}
|
||||
wezterm-surface = {workspace = true, features=["std", "appdata", "use_image"]}
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger.workspace = true
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::fmt;
|
||||
use std::result::Result;
|
||||
pub use termwiz::color::{AnsiColor, ColorAttribute, RgbColor, SrgbaTuple};
|
||||
pub use wezterm_cell::color::{AnsiColor, ColorAttribute, RgbColor, SrgbaTuple};
|
||||
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub struct Palette256(pub [SrgbaTuple; 256]);
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
use crate::color::ColorPalette;
|
||||
use downcast_rs::{impl_downcast, Downcast};
|
||||
use termwiz::cell::UnicodeVersion;
|
||||
use termwiz::surface::{Line, SequenceNo};
|
||||
use wezterm_bidi::ParagraphDirectionHint;
|
||||
use wezterm_cell::UnicodeVersion;
|
||||
use wezterm_surface::{Line, SequenceNo};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum NewlineCanon {
|
||||
|
||||
+5
-6
@@ -20,8 +20,8 @@ use anyhow::Error;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::ops::{Deref, DerefMut, Range};
|
||||
use std::str;
|
||||
use termwiz::surface::SequenceNo;
|
||||
use wezterm_dynamic::{FromDynamic, ToDynamic};
|
||||
use wezterm_surface::SequenceNo;
|
||||
|
||||
pub mod config;
|
||||
pub use config::TerminalConfiguration;
|
||||
@@ -29,9 +29,8 @@ pub use config::TerminalConfiguration;
|
||||
pub mod input;
|
||||
pub use crate::input::*;
|
||||
|
||||
pub use termwiz::cell::{self, *};
|
||||
|
||||
pub use termwiz::surface::line::*;
|
||||
pub use wezterm_cell::*;
|
||||
pub use wezterm_surface::line::*;
|
||||
|
||||
pub mod screen;
|
||||
pub use crate::screen::*;
|
||||
@@ -108,8 +107,8 @@ pub enum Position {
|
||||
pub struct CursorPosition {
|
||||
pub x: usize,
|
||||
pub y: VisibleRowIndex,
|
||||
pub shape: termwiz::surface::CursorShape,
|
||||
pub visibility: termwiz::surface::CursorVisibility,
|
||||
pub shape: wezterm_surface::CursorShape,
|
||||
pub visibility: wezterm_surface::CursorVisibility,
|
||||
pub seqno: SequenceNo,
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ use log::debug;
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::Arc;
|
||||
use termwiz::input::KeyboardEncoding;
|
||||
use termwiz::surface::SequenceNo;
|
||||
use wezterm_surface::SequenceNo;
|
||||
|
||||
/// Holds the model of a screen. This can either be the primary screen
|
||||
/// which includes lines of scrollback text, or the alternate screen
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::*;
|
||||
use crate::terminalstate::performer::Performer;
|
||||
use std::sync::Arc;
|
||||
use termwiz::escape::parser::Parser;
|
||||
use wezterm_escape_parser::parser::Parser;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "use_serde", derive(Serialize, Deserialize))]
|
||||
@@ -29,7 +29,7 @@ impl Clipboard for Box<dyn Clipboard> {
|
||||
}
|
||||
|
||||
pub trait DeviceControlHandler: Send + Sync {
|
||||
fn handle_device_control(&mut self, _control: termwiz::escape::DeviceControlMode);
|
||||
fn handle_device_control(&mut self, _control: wezterm_escape_parser::DeviceControlMode);
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq)]
|
||||
@@ -173,7 +173,7 @@ impl Terminal {
|
||||
self.trigger_unseen_output_notif();
|
||||
}
|
||||
|
||||
pub fn perform_actions(&mut self, actions: Vec<termwiz::escape::Action>) {
|
||||
pub fn perform_actions(&mut self, actions: Vec<wezterm_escape_parser::Action>) {
|
||||
self.state.increment_seqno();
|
||||
{
|
||||
let mut performer = Performer::new(&mut self.state);
|
||||
|
||||
@@ -4,10 +4,10 @@ use humansize::{SizeFormatter, DECIMAL};
|
||||
use num_traits::{One, Zero};
|
||||
use ordered_float::NotNan;
|
||||
use std::sync::Arc;
|
||||
use termwiz::cell::Cell;
|
||||
use termwiz::image::{ImageCell, ImageDataType};
|
||||
use termwiz::surface::change::ImageData;
|
||||
use termwiz::surface::TextureCoordinate;
|
||||
use wezterm_cell::image::{ImageCell, ImageDataType};
|
||||
use wezterm_cell::Cell;
|
||||
use wezterm_surface::change::ImageData;
|
||||
use wezterm_surface::TextureCoordinate;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct PlacementInfo {
|
||||
|
||||
@@ -3,8 +3,8 @@ use crate::TerminalState;
|
||||
use ::image::imageops::FilterType;
|
||||
use ::image::ImageFormat;
|
||||
use log::error;
|
||||
use termwiz::escape::osc::ITermFileData;
|
||||
use termwiz::image::ImageDataType;
|
||||
use wezterm_cell::image::ImageDataType;
|
||||
use wezterm_escape_parser::osc::ITermFileData;
|
||||
|
||||
impl TerminalState {
|
||||
pub(crate) fn set_image(&mut self, image: ITermFileData) {
|
||||
|
||||
@@ -9,13 +9,13 @@ use std::collections::{HashMap, HashSet};
|
||||
use std::io::Write;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use termwiz::escape::apc::{
|
||||
use wezterm_cell::image::ImageDataType;
|
||||
use wezterm_escape_parser::apc::{
|
||||
KittyFrameCompositionMode, KittyImage, KittyImageCompression, KittyImageData, KittyImageDelete,
|
||||
KittyImageFormat, KittyImageFrame, KittyImageFrameCompose, KittyImagePlacement,
|
||||
KittyImageTransmit, KittyImageVerbosity,
|
||||
};
|
||||
use termwiz::image::ImageDataType;
|
||||
use termwiz::surface::change::ImageData;
|
||||
use wezterm_surface::change::ImageData;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct KittyImageState {
|
||||
|
||||
@@ -12,18 +12,18 @@ use std::num::NonZeroUsize;
|
||||
use std::sync::mpsc::{channel, Sender};
|
||||
use std::sync::Arc;
|
||||
use terminfo::{Database, Value};
|
||||
use termwiz::cell::UnicodeVersion;
|
||||
use termwiz::escape::csi::{
|
||||
use termwiz::input::KeyboardEncoding;
|
||||
use url::Url;
|
||||
use wezterm_bidi::ParagraphDirectionHint;
|
||||
use wezterm_cell::image::ImageData;
|
||||
use wezterm_cell::UnicodeVersion;
|
||||
use wezterm_escape_parser::csi::{
|
||||
Cursor, CursorStyle, DecPrivateMode, DecPrivateModeCode, Device, Edit, EraseInDisplay,
|
||||
EraseInLine, Mode, Sgr, TabulationClear, TerminalMode, TerminalModeCode, Window, XtSmGraphics,
|
||||
XtSmGraphicsAction, XtSmGraphicsItem, XtSmGraphicsStatus, XtermKeyModifierResource,
|
||||
};
|
||||
use termwiz::escape::{OneBased, OperatingSystemCommand, CSI};
|
||||
use termwiz::image::ImageData;
|
||||
use termwiz::input::KeyboardEncoding;
|
||||
use termwiz::surface::{CursorShape, CursorVisibility, SequenceNo};
|
||||
use url::Url;
|
||||
use wezterm_bidi::ParagraphDirectionHint;
|
||||
use wezterm_escape_parser::{OneBased, OperatingSystemCommand, CSI};
|
||||
use wezterm_surface::{CursorShape, CursorVisibility, SequenceNo};
|
||||
|
||||
mod image;
|
||||
mod iterm;
|
||||
|
||||
@@ -10,23 +10,23 @@ use ordered_float::NotNan;
|
||||
use std::fmt::Write;
|
||||
use std::io::Write as _;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use termwiz::cell::{
|
||||
grapheme_column_width, is_white_space_grapheme, Cell, CellAttributes, SemanticType,
|
||||
};
|
||||
use termwiz::escape::csi::{
|
||||
CharacterPath, EraseInDisplay, Keyboard, KittyKeyboardFlags, KittyKeyboardMode,
|
||||
};
|
||||
use termwiz::escape::osc::{
|
||||
ChangeColorPair, ColorOrQuery, FinalTermSemanticPrompt, ITermProprietary,
|
||||
ITermUnicodeVersionOp, Selection,
|
||||
};
|
||||
use termwiz::escape::{
|
||||
Action, ControlCode, DeviceControlMode, Esc, EscCode, OperatingSystemCommand, CSI,
|
||||
};
|
||||
use termwiz::input::KeyboardEncoding;
|
||||
use unicode_normalization::{is_nfc_quick, IsNormalized, UnicodeNormalization};
|
||||
use url::Url;
|
||||
use wezterm_bidi::ParagraphDirectionHint;
|
||||
use wezterm_cell::{
|
||||
grapheme_column_width, is_white_space_grapheme, Cell, CellAttributes, SemanticType,
|
||||
};
|
||||
use wezterm_escape_parser::csi::{
|
||||
CharacterPath, EraseInDisplay, Keyboard, KittyKeyboardFlags, KittyKeyboardMode,
|
||||
};
|
||||
use wezterm_escape_parser::osc::{
|
||||
ChangeColorPair, ColorOrQuery, FinalTermSemanticPrompt, ITermProprietary,
|
||||
ITermUnicodeVersionOp, Selection,
|
||||
};
|
||||
use wezterm_escape_parser::{
|
||||
Action, ControlCode, DeviceControlMode, Esc, EscCode, OperatingSystemCommand, CSI,
|
||||
};
|
||||
|
||||
/// A helper struct for implementing `vtparse::VTActor` while compartmentalizing
|
||||
/// the terminal state and the embedding/host terminal interface
|
||||
@@ -493,7 +493,7 @@ impl<'a> Performer<'a> {
|
||||
self.flush_print();
|
||||
match csi {
|
||||
CSI::Sgr(sgr) => self.state.perform_csi_sgr(sgr),
|
||||
CSI::Cursor(termwiz::escape::csi::Cursor::Left(n)) => {
|
||||
CSI::Cursor(wezterm_escape_parser::csi::Cursor::Left(n)) => {
|
||||
// We treat CUB (Cursor::Left) the same as Backspace as
|
||||
// that is what xterm does.
|
||||
// <https://github.com/wezterm/wezterm/issues/1273>
|
||||
@@ -986,7 +986,7 @@ impl<'a> Performer<'a> {
|
||||
|
||||
OperatingSystemCommand::ChangeDynamicColors(first_color, colors) => {
|
||||
log::trace!("ChangeDynamicColors: {:?} {:?}", first_color, colors);
|
||||
use termwiz::escape::osc::DynamicColorNumber;
|
||||
use wezterm_escape_parser::osc::DynamicColorNumber;
|
||||
let mut idx: u8 = first_color as u8;
|
||||
for color in colors {
|
||||
let which_color: Option<DynamicColorNumber> = FromPrimitive::from_u8(idx);
|
||||
@@ -1041,7 +1041,7 @@ impl<'a> Performer<'a> {
|
||||
|
||||
OperatingSystemCommand::ResetDynamicColor(color) => {
|
||||
log::trace!("ResetDynamicColor: {:?}", color);
|
||||
use termwiz::escape::osc::DynamicColorNumber;
|
||||
use wezterm_escape_parser::osc::DynamicColorNumber;
|
||||
let which_color: Option<DynamicColorNumber> = FromPrimitive::from_u8(color as u8);
|
||||
if let Some(which_color) = which_color {
|
||||
macro_rules! reset {
|
||||
@@ -1076,7 +1076,7 @@ impl<'a> Performer<'a> {
|
||||
self.palette_did_change();
|
||||
}
|
||||
OperatingSystemCommand::ConEmuProgress(prog) => {
|
||||
use termwiz::escape::osc::Progress as TProg;
|
||||
use wezterm_escape_parser::osc::Progress as TProg;
|
||||
let prog = match prog {
|
||||
TProg::None => Progress::None,
|
||||
TProg::SetPercentage(p) => Progress::Percentage(p),
|
||||
|
||||
@@ -2,9 +2,9 @@ use crate::terminalstate::image::*;
|
||||
use crate::terminalstate::{default_color_map, ImageAttachParams};
|
||||
use crate::TerminalState;
|
||||
use ::image::RgbaImage;
|
||||
use termwiz::color::RgbColor;
|
||||
use termwiz::escape::{Sixel, SixelData};
|
||||
use termwiz::image::ImageDataType;
|
||||
use wezterm_cell::color::RgbColor;
|
||||
use wezterm_cell::image::ImageDataType;
|
||||
use wezterm_escape_parser::{Sixel, SixelData};
|
||||
|
||||
impl TerminalState {
|
||||
pub(crate) fn sixel(&mut self, sixel: Box<Sixel>) {
|
||||
|
||||
@@ -10,9 +10,9 @@ mod csi;
|
||||
use crate::color::ColorPalette;
|
||||
use k9::assert_equal as assert_eq;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use termwiz::escape::csi::{Edit, EraseInDisplay, EraseInLine};
|
||||
use termwiz::escape::{OneBased, OperatingSystemCommand, CSI};
|
||||
use termwiz::surface::{CursorShape, CursorVisibility, SequenceNo, SEQ_ZERO};
|
||||
use wezterm_escape_parser::csi::{Edit, EraseInDisplay, EraseInLine};
|
||||
use wezterm_escape_parser::{OneBased, OperatingSystemCommand, CSI};
|
||||
use wezterm_surface::{CursorShape, CursorVisibility, SequenceNo, SEQ_ZERO};
|
||||
|
||||
#[derive(Debug)]
|
||||
struct LocalClip {
|
||||
@@ -312,7 +312,7 @@ fn assert_all_contents(term: &Terminal, file: &str, line: u32, expect_lines: &[&
|
||||
|
||||
#[test]
|
||||
fn test_semantic_1539() {
|
||||
use termwiz::escape::osc::FinalTermSemanticPrompt;
|
||||
use wezterm_escape_parser::osc::FinalTermSemanticPrompt;
|
||||
let mut term = TestTerm::new(5, 10, 0);
|
||||
term.print(format!(
|
||||
"{}prompt\r\nwoot",
|
||||
@@ -348,7 +348,7 @@ fn test_semantic_1539() {
|
||||
|
||||
#[test]
|
||||
fn test_semantic() {
|
||||
use termwiz::escape::osc::FinalTermSemanticPrompt;
|
||||
use wezterm_escape_parser::osc::FinalTermSemanticPrompt;
|
||||
let mut term = TestTerm::new(5, 10, 0);
|
||||
term.print("hello");
|
||||
term.print(format!(
|
||||
@@ -1127,7 +1127,7 @@ fn test_scroll_margins() {
|
||||
term.print("1\n2\n3\n4\n");
|
||||
assert_all_contents(&term, file!(), line!(), &["1", "2", "3", "4", ""]);
|
||||
|
||||
let margins = CSI::Cursor(termwiz::escape::csi::Cursor::SetTopAndBottomMargins {
|
||||
let margins = CSI::Cursor(wezterm_escape_parser::csi::Cursor::SetTopAndBottomMargins {
|
||||
top: OneBased::new(1),
|
||||
bottom: OneBased::new(2),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user