Struct terminal_view2::TerminalView
source · pub struct TerminalView { /* private fields */ }
Expand description
A terminal view, maintains the PTY’s file handles and communicates with the terminal
Implementations§
source§impl TerminalView
impl TerminalView
sourcepub fn deploy(
workspace: &mut Workspace,
_: &NewCenterTerminal,
cx: &mut ViewContext<'_, Workspace>
)
pub fn deploy( workspace: &mut Workspace, _: &NewCenterTerminal, cx: &mut ViewContext<'_, Workspace> )
Create a new Terminal in the current working directory or the user’s home directory
pub fn new( terminal: Model<Terminal>, workspace: WeakView<Workspace>, workspace_id: WorkspaceId, cx: &mut ViewContext<'_, Self> ) -> Self
pub fn model(&self) -> &Model<Terminal>
pub fn has_new_content(&self) -> bool
pub fn has_bell(&self) -> bool
pub fn clear_bel(&mut self, cx: &mut ViewContext<'_, TerminalView>)
pub fn should_show_cursor( &self, focused: bool, cx: &mut ViewContext<'_, Self> ) -> bool
pub fn pause_cursor_blinking(&mut self, cx: &mut ViewContext<'_, Self>)
pub fn find_matches( &mut self, query: Arc<SearchQuery>, cx: &mut ViewContext<'_, Self> ) -> Task<Vec<RangeInclusive<Point>>>
pub fn terminal(&self) -> &Model<Terminal>
Trait Implementations§
source§impl FocusableView for TerminalView
impl FocusableView for TerminalView
fn focus_handle(&self, _cx: &AppContext) -> FocusHandle
source§impl InputHandler for TerminalView
impl InputHandler for TerminalView
fn text_for_range( &mut self, range: Range<usize>, cx: &mut ViewContext<'_, Self> ) -> Option<String>
fn selected_text_range( &mut self, cx: &mut ViewContext<'_, Self> ) -> Option<Range<usize>>
fn marked_text_range( &self, cx: &mut ViewContext<'_, Self> ) -> Option<Range<usize>>
fn unmark_text(&mut self, cx: &mut ViewContext<'_, Self>)
fn replace_text_in_range( &mut self, _: Option<Range<usize>>, text: &str, cx: &mut ViewContext<'_, Self> )
fn replace_and_mark_text_in_range( &mut self, range: Option<Range<usize>>, new_text: &str, new_selected_range: Option<Range<usize>>, cx: &mut ViewContext<'_, Self> )
fn bounds_for_range( &mut self, range_utf16: Range<usize>, element_bounds: Bounds<Pixels>, cx: &mut ViewContext<'_, Self> ) -> Option<Bounds<Pixels>>
source§impl Item for TerminalView
impl Item for TerminalView
fn tab_tooltip_text(&self, cx: &AppContext) -> Option<SharedString>
fn tab_content( &self, _detail: Option<usize>, cx: &WindowContext<'_> ) -> AnyElement
fn clone_on_split( &self, _workspace_id: WorkspaceId, _cx: &mut ViewContext<'_, Self> ) -> Option<View<Self>>
fn is_dirty(&self, _cx: &AppContext) -> bool
fn has_conflict(&self, _cx: &AppContext) -> bool
fn serialized_item_kind() -> Option<&'static str>
fn deserialize( project: Model<Project>, workspace: WeakView<Workspace>, workspace_id: WorkspaceId, item_id: ItemId, cx: &mut ViewContext<'_, Pane> ) -> Task<Result<View<Self>>>
fn added_to_workspace( &mut self, workspace: &mut Workspace, cx: &mut ViewContext<'_, Self> )
fn deactivated(&mut self, _: &mut ViewContext<'_, Self>)
fn workspace_deactivated(&mut self, _: &mut ViewContext<'_, Self>)
fn tab_description(&self, _: usize, _: &AppContext) -> Option<SharedString>
source§fn for_each_project_item(
&self,
_: &AppContext,
_: &mut dyn FnMut(EntityId, &dyn Item)
)
fn for_each_project_item( &self, _: &AppContext, _: &mut dyn FnMut(EntityId, &dyn Item) )
(model id, Item)
fn is_singleton(&self, _cx: &AppContext) -> bool
fn can_save(&self, _cx: &AppContext) -> bool
fn save( &mut self, _project: Model<Project>, _cx: &mut ViewContext<'_, Self> ) -> Task<Result<(), Error>>
fn save_as( &mut self, _project: Model<Project>, _abs_path: PathBuf, _cx: &mut ViewContext<'_, Self> ) -> Task<Result<(), Error>>
fn reload( &mut self, _project: Model<Project>, _cx: &mut ViewContext<'_, Self> ) -> Task<Result<(), Error>>
fn act_as_type<'a>( &'a self, type_id: TypeId, self_handle: &'a View<Self>, _: &'a AppContext ) -> Option<AnyView>
fn as_searchable( &self, _: &View<Self> ) -> Option<Box<dyn SearchableItemHandle, Global>>
fn show_toolbar(&self) -> bool
fn pixel_position_of_cursor(&self, _: &AppContext) -> Option<Point<Pixels>>
source§impl Render for TerminalView
impl Render for TerminalView
source§impl SearchableItem for TerminalView
impl SearchableItem for TerminalView
source§fn clear_matches(&mut self, cx: &mut ViewContext<'_, Self>)
fn clear_matches(&mut self, cx: &mut ViewContext<'_, Self>)
Clear stored matches
source§fn update_matches(
&mut self,
matches: Vec<Self::Match>,
cx: &mut ViewContext<'_, Self>
)
fn update_matches( &mut self, matches: Vec<Self::Match>, cx: &mut ViewContext<'_, Self> )
Store matches returned from find_matches somewhere for rendering
source§fn query_suggestion(&mut self, cx: &mut ViewContext<'_, Self>) -> String
fn query_suggestion(&mut self, cx: &mut ViewContext<'_, Self>) -> String
Return the selection content to pre-load into this search
source§fn activate_match(
&mut self,
index: usize,
_: Vec<Self::Match>,
cx: &mut ViewContext<'_, Self>
)
fn activate_match( &mut self, index: usize, _: Vec<Self::Match>, cx: &mut ViewContext<'_, Self> )
Focus match at given index into the Vec of matches
source§fn select_matches(
&mut self,
matches: Vec<Self::Match>,
cx: &mut ViewContext<'_, Self>
)
fn select_matches( &mut self, matches: Vec<Self::Match>, cx: &mut ViewContext<'_, Self> )
Add selections for all matches given.
source§fn find_matches(
&mut self,
query: Arc<SearchQuery>,
cx: &mut ViewContext<'_, Self>
) -> Task<Vec<Self::Match>>
fn find_matches( &mut self, query: Arc<SearchQuery>, cx: &mut ViewContext<'_, Self> ) -> Task<Vec<Self::Match>>
Get all of the matches for this query, should be done on the background
source§fn active_match_index(
&mut self,
matches: Vec<Self::Match>,
cx: &mut ViewContext<'_, Self>
) -> Option<usize>
fn active_match_index( &mut self, matches: Vec<Self::Match>, cx: &mut ViewContext<'_, Self> ) -> Option<usize>
Reports back to the search toolbar what the active match should be (the selection)
type Match = RangeInclusive<Point<Line, Column>>
fn supported_options() -> SearchOptions
fn replace( &mut self, _: &Self::Match, _: &SearchQuery, _: &mut ViewContext<'_, Self> )
fn match_index_for_direction( &mut self, matches: &Vec<Self::Match, Global>, current_index: usize, direction: Direction, count: usize, _: &mut ViewContext<'_, Self> ) -> usize
impl EventEmitter<Event> for TerminalView
impl EventEmitter<ItemEvent> for TerminalView
impl EventEmitter<SearchEvent> for TerminalView
Auto Trait Implementations§
impl !RefUnwindSafe for TerminalView
impl Send for TerminalView
impl Sync for TerminalView
impl Unpin for TerminalView
impl !UnwindSafe for TerminalView
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more