updates, fixes
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
d2717e35defd3c4c6b4ce6e49b77a4ad81c3d44a- Parents
-
4b8f2be - Tree
312674c
d2717e3
d2717e35defd3c4c6b4ce6e49b77a4ad81c3d44a4b8f2be
312674c| Status | File | + | - |
|---|---|---|---|
| M |
c_src/freetype_helpers.c
|
9 | 3 |
| M |
c_src/pty_helpers.c
|
2 | 3 |
| M |
src/window/window.f90
|
7 | 1 |
c_src/freetype_helpers.cmodified@@ -40,10 +40,16 @@ void fortty_ft_done_face(FT_Face face) { | ||
| 40 | 40 | /* Get font metrics for terminal cell sizing */ |
| 41 | 41 | void fortty_ft_get_metrics(FT_Face face, int *cell_width, int *cell_height, |
| 42 | 42 | int *ascender, int *descender) { |
| 43 | - /* Use the scaled max advance from size metrics (26.6 fixed-point pixels). | |
| 44 | - * Note: face->max_advance_width is in font units (unscaled), not pixels! | |
| 43 | + /* For monospace fonts, get cell width from actual glyph advance of 'M' | |
| 44 | + * (max_advance can be wrong for some fonts like NotoSansMono) | |
| 45 | 45 | */ |
| 46 | - *cell_width = face->size->metrics.max_advance >> 6; | |
| 46 | + FT_Error err = FT_Load_Char(face, 'M', FT_LOAD_DEFAULT); | |
| 47 | + if (err == 0) { | |
| 48 | + *cell_width = face->glyph->advance.x >> 6; | |
| 49 | + } else { | |
| 50 | + /* Fallback to max_advance if glyph load fails */ | |
| 51 | + *cell_width = face->size->metrics.max_advance >> 6; | |
| 52 | + } | |
| 47 | 53 | |
| 48 | 54 | /* Height from font metrics (in 1/64 pixels, convert to pixels) */ |
| 49 | 55 | *ascender = face->size->metrics.ascender >> 6; |
c_src/pty_helpers.cmodified@@ -63,9 +63,8 @@ int fortty_pty_fork(const char *shell, int rows, int cols) { | ||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - /* Execute shell as login shell */ | |
| 67 | - /* Using -l flag for login shell behavior */ | |
| 68 | - execlp(sh, sh, "-l", (char *)NULL); | |
| 66 | + /* Execute shell as interactive shell (not login) */ | |
| 67 | + execlp(sh, sh, (char *)NULL); | |
| 69 | 68 | |
| 70 | 69 | /* If exec fails */ |
| 71 | 70 | perror("execlp"); |
src/window/window.f90modified@@ -381,7 +381,13 @@ contains | ||
| 381 | 381 | pending_pane_action = PANE_ACTION_NAV_DOWN |
| 382 | 382 | return |
| 383 | 383 | |
| 384 | - ! Pane navigation with vim keys: Cmd/Ctrl + hjkl | |
| 384 | + end select | |
| 385 | + end if | |
| 386 | + | |
| 387 | + ! Pane navigation with vim keys: Super/Cmd + hjkl only (not Ctrl) | |
| 388 | + ! This allows Ctrl+L (clear), Ctrl+H, etc. to pass through to the shell | |
| 389 | + if (iand(mods, GLFW_MOD_SUPER) /= 0 .and. iand(mods, GLFW_MOD_CONTROL) == 0) then | |
| 390 | + select case (key) | |
| 385 | 391 | case (GLFW_KEY_H) |
| 386 | 392 | pending_pane_action = PANE_ACTION_NAV_LEFT |
| 387 | 393 | return |