Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

lord-server: survive SIGPIPE when a client hangs up mid-write (caught, so exec'd children keep the default); translate the Terminal import placeholder

Federico Pereira0cb0be5f3e60
diff --git a/apps/terminal/Preferences.jsx b/apps/terminal/Preferences.jsx
index b050d5c..21830d1 100644
--- a/apps/terminal/Preferences.jsx
+++ b/apps/terminal/Preferences.jsx
@@ -246,7 +246,7 @@ function ImportPanel({ t, onClose, onDone }) {
<Text style={{ fontSize: typeScale.callout, color: t.textDim, lineHeight: 1.4, textAlign: 'start' }}>{T('terminal.prefs.import.intro')}</Text>
</View>
<View style={{ flexDirection: 'row', gap: spacing.s, alignItems: 'center' }}>
- <TextInput value={path} placeholder="~/Descargas/Profiles.json" onChange={setPath} onSubmit={load} style={{ flex: 1 }} />
+ <TextInput value={path} placeholder={T('terminal.prefs.import.placeholder')} onChange={setPath} onSubmit={load} style={{ flex: 1 }} />
<Button label={T('terminal.prefs.cancel')} onClick={onClose} />
<Button label={T('terminal.prefs.import.open')} primary onClick={() => load(path)} />
</View>
diff --git a/assets/locales/en/terminal.json b/assets/locales/en/terminal.json
index d83c978..b6301dc 100644
--- a/assets/locales/en/terminal.json
+++ b/assets/locales/en/terminal.json
@@ -202,6 +202,7 @@
"other": "Color presets ({count})"
},
"prefs.import.title": "Import Profiles",
+ "prefs.import.placeholder": "~/Downloads/Profiles.json",
"prefs.import.triggers": {
"one": "{count} trigger",
"other": "{count} triggers"
diff --git a/assets/locales/es/terminal.json b/assets/locales/es/terminal.json
index 4ab9d0f..e30ff73 100644
--- a/assets/locales/es/terminal.json
+++ b/assets/locales/es/terminal.json
@@ -202,6 +202,7 @@
"other": "Esquemas de color ({count})"
},
"prefs.import.title": "Importar perfiles",
+ "prefs.import.placeholder": "~/Descargas/Profiles.json",
"prefs.import.triggers": {
"one": "{count} disparador",
"other": "{count} disparadores"
diff --git a/assets/locales/pt/terminal.json b/assets/locales/pt/terminal.json
index f93da0a..3e61e28 100644
--- a/assets/locales/pt/terminal.json
+++ b/assets/locales/pt/terminal.json
@@ -202,6 +202,7 @@
"other": "Esquemas de cores ({count})"
},
"prefs.import.title": "Importar perfis",
+ "prefs.import.placeholder": "~/Downloads/Profiles.json",
"prefs.import.triggers": {
"one": "{count} gatilho",
"other": "{count} gatilhos"
diff --git a/server/src/main.c b/server/src/main.c
index 5da78be..d20b894 100644
--- a/server/src/main.c
+++ b/server/src/main.c
@@ -1324,12 +1324,20 @@ static int hw_heads(Kms **out, int max) {
static void hw_redraw(void) { if (hw_server) full_damage(hw_server); }
static const DisplayHost hw_host = { hw_kms, hw_redraw, js_hw_event, hw_heads };
+/* A client that hangs up mid-write (remote desktop, Wayland, a helper) must not kill the
+ * session: writes get EPIPE instead. Caught, not SIG_IGN, so exec'd children (shells, Linux
+ * apps) get the default SIGPIPE back, as execve resets caught signals. */
+static void on_sigpipe(int sig) { (void)sig; }
+
static void usage(const char *argv0) {
fprintf(stderr, "usage: %s [--theme bundle.js] [--fonts dir] [--shell dir] [--user name] [--card /dev/dri/cardN]\n"
" [--headless WIDTHxHEIGHT [--greeter]] [--timeout s] [--debug] [--profile]\n", argv0);
}
int main(int argc, char **argv) {
+ struct sigaction pipe_sa = { .sa_handler = on_sigpipe };
+ sigemptyset(&pipe_sa.sa_mask);
+ sigaction(SIGPIPE, &pipe_sa, NULL);
/* guardián de una sesión de terminal (ver term/hold.c): no abre pantalla ni input */
if (argc > 1 && !strcmp(argv[1], "--term-holder")) return hold_main(argc, argv);
/* «modo app»: lord-server --app <id> corre una app .lpk como cliente Wayland aislado