summaryrefslogtreecommitdiffstats
path: root/src/term_extra.hh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 04:48:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 04:48:35 +0000
commit207df6fc406e81bfeebdff7f404bd242ff3f099f (patch)
treea1a796b056909dd0a04ffec163db9363a8757808 /src/term_extra.hh
parentReleasing progress-linux version 0.11.2-1~progress7.99u1. (diff)
downloadlnav-207df6fc406e81bfeebdff7f404bd242ff3f099f.tar.xz
lnav-207df6fc406e81bfeebdff7f404bd242ff3f099f.zip
Merging upstream version 0.12.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/term_extra.hh')
-rw-r--r--src/term_extra.hh17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/term_extra.hh b/src/term_extra.hh
index 9740315..6193290 100644
--- a/src/term_extra.hh
+++ b/src/term_extra.hh
@@ -41,7 +41,7 @@
#include <unistd.h>
#include "listview_curses.hh"
-#include "log_format.hh"
+#include "log_format_fwd.hh"
#include "logfile.hh"
class term_extra {
@@ -69,8 +69,6 @@ public:
void update_title(listview_curses* lc)
{
- static const char* xterm_title_fmt = "\033]0;%s\007";
-
if (!this->te_enabled) {
return;
}
@@ -84,12 +82,12 @@ public:
auto line_attr_opt = get_string_attr(sa, logline::L_FILE);
if (line_attr_opt) {
auto lf = line_attr_opt.value().get();
- const std::string& filename = lf->get_unique_path();
+ const auto& filename = lf->get_unique_path();
if (filename != this->te_last_title) {
- std::string title = this->te_prefix + filename;
-
- printf(xterm_title_fmt, title.c_str());
+ fmt::print(FMT_STRING("\033]0;{}{}\007"),
+ this->te_prefix,
+ filename);
fflush(stdout);
this->te_last_title = filename;
@@ -101,9 +99,8 @@ public:
const std::string& view_title = lc->get_title();
if (view_title != this->te_last_title) {
- std::string title = this->te_prefix + view_title;
-
- printf(xterm_title_fmt, title.c_str());
+ fmt::print(
+ FMT_STRING("\033]0;{}{}\007"), this->te_prefix, view_title);
fflush(stdout);
this->te_last_title = view_title;