dvtm

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5297f3a82cbf5e14ab230c983440ca7c362f27ce
parent 5ebc1f5b3e60c7fd44fdb3b4e74802fc6666b337
Author: Andrew Laack <andrew@laack.co>
Date:   Sun,  7 Sep 2025 17:04:47 -0500

Added a few fixes

Diffstat:
Mdvtm.c | 2+-
Mvt.c | 9++++++++-
Mvt.h | 1+
3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -1149,7 +1149,7 @@ copymode(const char *args[]) { const char *argv[3] = { args[0], NULL, NULL }; char argline[32]; - int line = vt_content_start(sel->app); + int line = vt_content_end(sel->app); snprintf(argline, sizeof(argline), "+%d", line); argv[1] = argline; diff --git a/vt.c b/vt.c @@ -971,6 +971,7 @@ static void interpret_csi_priv_mode(Vt *t, int param[], int pcount, bool set) if (!set) buffer_clear(&t->buffer_alternate); t->buffer = set ? &t->buffer_alternate : &t->buffer_normal; + cursor_clamp(t); vt_dirty(t); if (param[i] != 1049) break; @@ -1158,7 +1159,7 @@ static void interpret_osc(Vt *t) case 0: /* icon name and window title */ case 2: /* window title */ if (t->title_handler) - t->title_handler(t, data+1); + 0; break; case 1: /* icon name */ break; @@ -1979,3 +1980,9 @@ int vt_content_start(Vt *t) { return t->buffer->scroll_above; } + +int vt_content_end(Vt *t) +{ + int curs_row = t->buffer->curs_row - t->buffer->lines; + return vt_content_start(t) + curs_row; +} diff --git a/vt.h b/vt.h @@ -62,5 +62,6 @@ void vt_noscroll(Vt*); pid_t vt_pid_get(Vt*); size_t vt_content_get(Vt*, char **s, bool colored); int vt_content_start(Vt*); +int vt_content_end(Vt*); #endif /* VT_H */