fixes: improve login environment handling (#114)

* chore(organization): allow nested header and c files

* feat: add shell login "middleware" & etc:
  * lidm now calls `bash` (or other shells, depends on PACKAGE cfg) in
  login mode as a session wrapper to source most env (can be disabled)
  * this fixes a lot of env problems with all `/etc/profile` and more

Extra:
* implemented a musl compatible version of `execvpe` and now lidm should
  search for PATH everywhere it needs to
* `search_path` now also checks if the found binary is properly
  executable
* lidm now uses `confstr` for a decent PATH default if none is found
* logs are unbuffered for cases where debug logs appear empty (exit
  without handlers moment)

* chore: one-time evaluate certain makefile vars

---------

Co-authored-by: grialion <48643945+grialion@users.noreply.github.com>
This commit is contained in:
2026-02-07 17:12:03 +01:00
committed by GitHub
parent c009c6c31c
commit 0b2d0bdf03
34 changed files with 555 additions and 424 deletions

View File

@@ -1,7 +1,10 @@
#ifndef KEYSH_
#define KEYSH_
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/time.h>
enum Keys {
ESC,
@@ -103,4 +106,15 @@ static const struct key_mapping KEY_MAPPINGS[] = {
{PAGE_DOWN, {"\x1b[6~", NULL}},
};
struct option_keys {
bool is_some;
enum Keys key;
};
int find_keyname(enum Keys* at, const char* name);
struct option_keys find_ansi(const char* seq);
void read_press(uint8_t* length, char* out);
// non blocking, waits up to tv or interrupt, returns true if actually read
bool read_press_nb(uint8_t* length, char* out, struct timeval* tv);
#endif