You are not logged in.

#1 2026-01-08 11:48:58

avidseeker
Member
Registered: 2022-09-06
Posts: 68
Website

TUI programs with a fallback shell

Running a terminal emulator session (e.g: `lxterminal -e tui_prog`) where tui_prog accepts ctrl-z signal, pressing ctrl-z causes the terminal to hang since there is no shell to fall back to.

There are two possible solutions I see for this:

1. Run lxterminal with a shell fallback: lxterminal -e sh -c 'lf; exec sh'

2. Run shell interactively first, then execute the program on top of it.

Here I'm using `lf` file manager as the reference tui_prog mentioned.

For some reason method 1. doesn't seem to work with lxterminal and lf. Process keeps hanging.

Method two seems to hold two contradicting flags: sh -i -c '...' where -i is interactive and -c is non-interactive

What's the solution to this?

Avid

Offline

#2 2026-01-08 12:12:37

5hridhyan
Member
From: Asia
Registered: 2025-12-25
Posts: 298

Re: TUI programs with a fallback shell

"-i -c" is not contradictory here. An interactive shell with job control enabled must exist before lf starts, otherwise the shell cannot reclaim the TTY when lf stops.
try with

lxterminal -e sh -ic lf

or

lxterminal -e sh -ic 'set -m; lf'

Last edited by 5hridhyan (2026-01-08 13:28:19)


I expect some mercy from my fellow humans! ^^
Keep your virtue sharpened in a kingdom of carrion, and the throne they offer will be built from your ribs.

Offline

#3 2026-01-08 14:24:02

avidseeker
Member
Registered: 2022-09-06
Posts: 68
Website

Re: TUI programs with a fallback shell

Hmm, both commands don't work on my end. Can you replicate?

Offline

#4 2026-01-08 14:31:02

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,365

Re: TUI programs with a fallback shell

Tail your shell rc (eg .zshrc or .bashrc) with

[ -n "$SH_AUTOSTART" ] && env -u SH_AUTOSTART $SH_AUTOSTART; unset SH_AUTOSTART

and run

env SH_AUTOSTART=fi lxterminal

Offline

#5 2026-01-08 14:32:45

5hridhyan
Member
From: Asia
Registered: 2025-12-25
Posts: 298

Re: TUI programs with a fallback shell

Hmm, both commands don't work on my end. Can you replicate?

my bad, Run a real interactive session first....

Last edited by 5hridhyan (2026-01-08 15:05:08)


I expect some mercy from my fellow humans! ^^
Keep your virtue sharpened in a kingdom of carrion, and the throne they offer will be built from your ribs.

Offline

Board footer

Powered by FluxBB