Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosIntel Devs: Smart AI Edge Solutions - 0 Introduction | Intel Software(22.09.2026 um 23:48 Uhr)
Windows Tipps & SecurityGoogles gibt Chrome 154 frei und schließt über 100 Lücken(23.09.2026 um 09:11 Uhr)
Windows Tipps & SecurityKlangerlebnis & Sicherheit im Vonovia Ruhrstadion(23.09.2026 um 08:45 Uhr)
Unix & Linux ServerLocal AI Jargon Quiz: Do You Know All These Buzzwords?(23.09.2026 um 08:38 Uhr)
Sichere ProgrammierungNeu von AWS: Weniger Kontextpflege für selbst gebaute KI-Agenten(23.09.2026 um 09:52 Uhr)
Sichere ProgrammierungLINQ GroupBy: The Operator Everyone Uses Wrong(23.09.2026 um 09:41 Uhr)
Sichere ProgrammierungIT Heard About the Acquisition Nine Days Before It Closed(23.09.2026 um 09:45 Uhr)
YouTube Security VideosIntel Devs: Smart AI Edge Solutions - 0 Introduction | Intel Software(22.09.2026 um 23:48 Uhr)
Windows Tipps & SecurityGoogles gibt Chrome 154 frei und schließt über 100 Lücken(23.09.2026 um 09:11 Uhr)
Windows Tipps & SecurityKlangerlebnis & Sicherheit im Vonovia Ruhrstadion(23.09.2026 um 08:45 Uhr)
Unix & Linux ServerLocal AI Jargon Quiz: Do You Know All These Buzzwords?(23.09.2026 um 08:38 Uhr)
Sichere ProgrammierungNeu von AWS: Weniger Kontextpflege für selbst gebaute KI-Agenten(23.09.2026 um 09:52 Uhr)
Sichere ProgrammierungLINQ GroupBy: The Operator Everyone Uses Wrong(23.09.2026 um 09:41 Uhr)
Sichere ProgrammierungIT Heard About the Acquisition Nine Days Before It Closed(23.09.2026 um 09:45 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

got tired of typing blindly in termux, have a conditional shell prompt function

started working from my phone with ssh and termux so I can bedrot and develop, but was having issues with the screen size whith some of my descriptive mamba env names and long paths. figured I'd share my solution in case somebody asks gpt…

0
↗ Quelle (reddit.com)
Reagiere als Erste:r — dein Feedback zählt!

started working from my phone with ssh and termux so I can bedrot and develop, but was having issues with the screen size whith some of my descriptive mamba env names and long paths. figured I'd share my solution in case somebody asks gpt later so that Sam Altman takes the credit

throw this code directly into bashrc towards the top, and it will drop you to a new line if the prompt gets too long. The function runs with each command so if you cd too greedily and too deep, the command line input will be on a newline instead of inline. Once you are back at root the prompt will be inline again. Goes by the actual length of the entire prompt regardless of where the text is from. You still see the venv and conda text like normal, which tends not to be the case when PS1 gets edited. So now when you scroll up you don't have any partial words after long terminal promts, but you also don't have short commands that don't need a newline

conditional terminal prompt

update_ps1() {

# the number of columns before repl drops a line local threshold=55 # default is white # local colour='34' # blue # local colour='32' # dark green local colour='92' # green # local colour='33' # yellow # local colour='31' # dark red # local colour='91' # red # whether the user@host is bold, hard to notice tbf local bold='1' # local bold='0' local venv="" if [ -n "$VIRTUAL_ENV" ]; then venv="($VIRTUAL_ENV_PROMPT) " fi if [ "$(echo "${PS1@P}" | wc -m)" -lt "$threshold" ]; then PS1="${CONDA_PROMPT_MODIFIER}$venv\e["$bold\;$colour"m$(whoami)@$(uname -n)\e[0m:\e[0"$colour"m \w\e[0m $ " else PS1="${CONDA_PROMPT_MODIFIER}$venv\e["$bold\;$colour"m$(whoami)@$(uname -n)\e[0m:\e[0"$colour"m \w\e[0m\n $ " fi 

}; PROMPT_COMMAND="update_ps1${PROMPT_COMMAND:+;$PROMPT_COMMAND}"

submitted by /u/probablyblocked
[link] [comments]
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten got tired of typing blindly in termux, have a conditional shell prompt function

Thematisch verwandte Begriffe: tired, typing, blindly, termux · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96258 | A vulnerability has been found in onSite internet GmbH Auktion NG Auktio…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick