commit
d3e396631f
6 changed files with 119 additions and 127 deletions
|
|
@ -199,7 +199,7 @@ pub struct Profile {
|
|||
#[serde(default)]
|
||||
pub working_directory: String,
|
||||
#[serde(default)]
|
||||
pub hold: bool,
|
||||
pub drain_on_exit: bool,
|
||||
}
|
||||
|
||||
impl Default for Profile {
|
||||
|
|
@ -211,7 +211,7 @@ impl Default for Profile {
|
|||
syntax_theme_light: COSMIC_THEME_LIGHT.to_string(),
|
||||
tab_title: String::new(),
|
||||
working_directory: String::new(),
|
||||
hold: false,
|
||||
drain_on_exit: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,7 @@ impl App {
|
|||
.spacing(space_xxxs)
|
||||
.into(),
|
||||
widget::horizontal_space().into(),
|
||||
widget::toggler(profile.hold)
|
||||
widget::toggler(profile.drain_on_exit)
|
||||
.on_toggle(move |t| Message::ProfileHold(profile_id, t))
|
||||
.into(),
|
||||
])
|
||||
|
|
@ -1309,7 +1309,7 @@ impl App {
|
|||
let options = tty::Options {
|
||||
shell,
|
||||
working_directory,
|
||||
hold: profile.hold,
|
||||
drain_on_exit: profile.drain_on_exit,
|
||||
env: HashMap::new(),
|
||||
};
|
||||
let tab_title_override = if profile.tab_title.is_empty() {
|
||||
|
|
@ -2252,9 +2252,9 @@ impl Application for App {
|
|||
Message::ProfileExpand(profile_id) => {
|
||||
self.profile_expanded = Some(profile_id);
|
||||
}
|
||||
Message::ProfileHold(profile_id, hold) => {
|
||||
Message::ProfileHold(profile_id, drain_on_exit) => {
|
||||
if let Some(profile) = self.config.profiles.get_mut(&profile_id) {
|
||||
profile.hold = hold;
|
||||
profile.drain_on_exit = drain_on_exit;
|
||||
return self.save_profiles();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,8 +224,8 @@ impl MouseReporter {
|
|||
};
|
||||
|
||||
//Generate term codes
|
||||
let x_iter = std::iter::repeat(button_no_x).take(lines_x.unsigned_abs() as _);
|
||||
let y_iter = std::iter::repeat(button_no_y).take(lines_y.unsigned_abs() as _);
|
||||
let x_iter = std::iter::repeat_n(button_no_x, lines_x.unsigned_abs() as _);
|
||||
let y_iter = std::iter::repeat_n(button_no_y, lines_y.unsigned_abs() as _);
|
||||
|
||||
x_iter
|
||||
.chain(y_iter)
|
||||
|
|
|
|||
|
|
@ -328,7 +328,8 @@ impl Terminal {
|
|||
let window_id = 0;
|
||||
let pty = tty::new(&options, size.into(), window_id)?;
|
||||
|
||||
let pty_event_loop = EventLoop::new(term.clone(), event_proxy, pty, options.hold, false)?;
|
||||
let pty_event_loop =
|
||||
EventLoop::new(term.clone(), event_proxy, pty, options.drain_on_exit, false)?;
|
||||
let notifier = Notifier(pty_event_loop.channel());
|
||||
let _pty_join_handle = pty_event_loop.spawn();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue