mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
Set terminal title to currently focused file
This commit is contained in:
parent
03f2bcc60b
commit
a1228e0aa1
@ -575,6 +575,19 @@ pub fn render_statusline(
|
||||
surface.set_style(viewport.with_height(1), style);
|
||||
if is_focused {
|
||||
surface.set_string(viewport.x + 1, viewport.y, mode, style);
|
||||
|
||||
// TODO: put this in a better place and possibly cache
|
||||
let _ = crossterm::execute!(
|
||||
std::io::stdout(),
|
||||
crossterm::terminal::SetTitle(format!(
|
||||
"{} - Helix",
|
||||
doc.relative_path()
|
||||
.as_deref()
|
||||
.unwrap_or(std::path::Path::new("[scratch]"))
|
||||
.to_str()
|
||||
.unwrap()
|
||||
))
|
||||
);
|
||||
}
|
||||
surface.set_string(viewport.x + 5, viewport.y, progress, style);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user