Bug 498452

Summary: restored tabs get wrong setting: neither KONSOLE_DBUS_WINDOW environment variable, nor bash aliases
Product: [Applications] konsole Reporter: Igor Zhuravlov <zhuravlov.ip>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 22.12.3   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: tab#1, restored session mc, env command - broken
tab#1, restored session mc, pstree command - broken
tab#2, manually opened tab, built-in profile, mc, env command - ok
tab#2, manually opened tab, built-in profile, mc, pstree command - ok
tab#3, manually opened tab, mc profile, env command - ok
tab#3, manually opened tab, mc profile, pstree command - ok

Description Igor Zhuravlov 2025-01-10 04:24:26 UTC
Created attachment 177242 [details]
tab#1, restored session mc, env command - broken

SUMMARY

STEPS TO REPRODUCE
1. Run Konsole.
2. Open some tabs, e.g. with bash and mc.
3. Re-login session / reboot PC.

OBSERVED RESULT
Konsole session is restored ok with tabs opened at step 2. But restored tabs behavior is weird:
- no environment variables: BASH_FUNC_mc%%, GPG_TTY, HISTCONTROL, KONSOLE_DBUS_WINDOW, LS_COLORS, LS_OPTIONS, MC_SID
- no bash aliases
- mc never pauses after command execution

EXPECTED RESULT
Konsole tab should behave the same regardless of whether it was restored from previous session or opened manually by user.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 5.14.21-150500.55.88-default #1 SMP PREEMPT_DYNAMIC x86_64
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

1. But if a new tab was opened manually, it behaves properly: environment vars and bash aliases are presented, pause after execution works. Regardless of the way a tab was opened:
- manually run dedicated mc profile,
- or manually run default profile, then run mc there.

2. Similar bugs:
- https://bugs.kde.org/show_bug.cgi?id=382116
- https://bugs.kde.org/show_bug.cgi?id=365449
Comment 1 Igor Zhuravlov 2025-01-10 04:25:34 UTC
Created attachment 177243 [details]
tab#1, restored session mc, pstree command - broken
Comment 2 Igor Zhuravlov 2025-01-10 04:27:39 UTC
Created attachment 177244 [details]
tab#2, manually opened tab, built-in profile, mc, env command - ok
Comment 3 Igor Zhuravlov 2025-01-10 04:28:08 UTC
Created attachment 177245 [details]
tab#2, manually opened tab, built-in profile, mc, pstree command - ok
Comment 4 Igor Zhuravlov 2025-01-10 04:29:13 UTC
Created attachment 177246 [details]
tab#3, manually opened tab, mc profile, env command - ok
Comment 5 Igor Zhuravlov 2025-01-10 04:29:42 UTC
Created attachment 177247 [details]
tab#3, manually opened tab, mc profile, pstree command - ok
Comment 6 Igor Zhuravlov 2025-01-20 00:31:09 UTC
A Konsole profile:

host:~$ cat /home/johndoe/.local/share/konsole/mc.profile
[Appearance]
ColorScheme=BlackOnWhite
Font=Monospace,11,-1,5,50,0,0,0,0,0

[General]
Command=/usr/bin/mc
Icon=mc
Name=mc
Parent=FALLBACK/

[Interaction Options]
AutoCopySelectedText=true

[Scrolling]
HistoryMode=2

Default user shell:

host:~$ grep johndoe /etc/passwd
johndoe:x:1000:100:John Doe:/home/johndoe:/bin/bash