Bug 488396

Summary: konsole --tabs-from-file sometimes fails to open a window
Product: [Applications] konsole Reporter: TraceyC <kdedev>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal CC: cyril42e, teeks99
Priority: NOR    
Version: 24.02.2   
Target Milestone: ---   
Platform: Solus   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description TraceyC 2024-06-12 03:26:50 UTC
After creating and testing a couple of tab configuration files, Konsole would no longer open a window with --tabs-from-file

STEPS TO REPRODUCE
1. Create a simple tab configuration file with just one line
title: Tab1;; command: /usr/bin/top

2. Attempt to launch Konsole with the file using:  konsole --hold --tabs-from-file konsole_layouts/test1

OBSERVED RESULT
A window of the right size appears for a split second and immediately disappears

EXPECTED RESULT
A new window opens with the tab specified in the config file

SOFTWARE/OS VERSIONS
Operating System: Solus 4.5
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.8.11-292.current (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
I'm happy to help troubleshoot the problem. If necessary, please let me know what I can do to provide more information.

During my testing, at first the feature worked. At some point, perhaps due to a command in a tab Konsole didn't like? --tabs-from-file stopped opening a new window. 
Closing all editors that had the config files opened allowed it to work again, but it stopped working again after additional testing.
I made sure only one konsole process was running after pressing Ctrl-C to get rid of the ghost window
I rebooted, but that didn't change anything

There are no lines written to the system log at the time of the window failing to open
This is the only output in terminal (from what I've read, the error isn't really related)

Then, I launched with a different profile that had this and it was successful
title: SysAdminNotes ;; workdir: ~/Nextcloud/Notes/SysAdmin ;; profile: Sand
title: htpc ;; command: ssh htpc

I don't know if it was opening a very different tabs config or some timeout happened in the background that allowed it to work again.

❯ konsole --tabs-from-file konsole_layouts/test1
Qt: Session management error: None of the authentication protocols specified are supported

There is no crash, the process list shows the command still running
❯ pgrep -fla konsole
3379 /usr/bin/konsole
10770 konsole --tabs-from-file konsole_layouts/test1
Comment 1 TraceyC 2024-06-13 01:23:43 UTC
gdb didn't produce anything useful

Starting program: /usr/bin/konsole --hold --tabs-from-file konsole_layouts/onlyvps
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
[New Thread 0x7fffe96006c0 (LWP 52830)]
[New Thread 0x7fffe8c006c0 (LWP 52831)]
Qt: Session management error: None of the authentication protocols specified are supported
[New Thread 0x7fffe1e006c0 (LWP 52833)]
[New Thread 0x7fffe14006c0 (LWP 52834)]
[New Thread 0x7fffe0a006c0 (LWP 52835)]
[New Thread 0x7fffd7e006c0 (LWP 52836)]
[Detaching after fork from child process 52837]
[Detaching after fork from child process 52839]
[New Thread 0x7fffd6c006c0 (LWP 52854)]
[New Thread 0x7fffd62006c0 (LWP 52855)]
[New Thread 0x7fffd58006c0 (LWP 52856)]
[Thread 0x7fffd62006c0 (LWP 52855) exited]
[Thread 0x7fffd58006c0 (LWP 52856) exited]
[Thread 0x7fffd6c006c0 (LWP 52854) exited]
[Thread 0x7fffe0a006c0 (LWP 52835) exited]
[Thread 0x7fffe14006c0 (LWP 52834) exited]
[Thread 0x7fffe1e006c0 (LWP 52833) exited]
[Thread 0x7fffd7e006c0 (LWP 52836) exited]

I have been able to reproduce the disappearing with a one line tabs file "onlyvps" which uses one profile (which invokes eternal terminal)

    title: VPS ;; profile: VPS

Or using a tabs file htpc which has

    title: htpc ;; command: ssh htpc

When the bug is happening, I *can* open tabs from a file *if* it has no commands using ssh or et
But this also works:

    title: SysAdminNotes ;; workdir: ~/Nextcloud/Notes/SysAdmin ;; profile: Sand
    title: htpc ;; command: ssh htpc ;; profile: NavyBlue

This does not:

    title: SysAdminNotes ;; workdir: ~/Nextcloud/Notes/SysAdmin ;; profile: Sand
    title: htpc ;; command: ssh htpc ;; profile: NavyBlue
    title: SysMon ;; command: btm ;; profile: Ocean

This opens the window but the 'btm" command is not run (no profile for the SysMon tab)

    title: SysAdminNotes ;; workdir: ~/Nextcloud/Notes/SysAdmin ;; profile: Sand
    title: htpc ;; command: ssh htpc ;; profile: NavyBlue
    title: SysMon ;; command: btm

The "Ocean" profile is OK, I can open konsole with it this way

    konsole --profile Ocean

This does not work (window disappears)

    title: SysAdminNotes ;; workdir: ~/Nextcloud/Notes/SysAdmin ;; profile: Sand
    title: htpc ;; command: ssh htpc ;; profile: NavyBlue
    title: SysMon ;; command: /usr/bin/btm
Comment 2 Thomas Kent 2024-09-15 13:45:19 UTC
I'm able to reproduce this, in fact I've been seeing it for several months. It particularly seems to be a problem where I have multiple tabs that use the `autossh` command. 

One important note, even though the konsole window goes away, the processes it started are still running. 

It seems like if my file with tabs in it has a single instance of autossh, it will launch fine. When I add a second one, then the window will not open. Also, this is not 100% of the time, occasionally I will see the window launch normally.
Comment 3 Thomas Kent 2024-09-15 21:59:45 UTC
I just tried to reproduce in a testing version of KDE Neon (neon-testing-20240910-0249.iso, plasma 6.1.5, konsole 24.08.0), and was unable to reproduce it there. 

I originally tried in Ubuntu 22.04 (plasma 5.24.7, konsole 21.12.3) and 24.04 (plasma 5.27.11, konsole 23.08.5) instances.
Comment 4 Cyril42e 2024-10-15 22:32:45 UTC
I have the same issue on my Gentoo system with Fluxbox/X11. I had it with Plasma <= 5.64 Konsole <= 23.08, and I still have it with Plasma 6.1.5 Konsole 24.08.1. I haven't found something special about the command or the profile to make it work though, it doesn't work both with trivial tab files and complex ones, except very rarely and randomly.
Comment 5 TraceyC 2024-10-16 20:23:51 UTC
I'm no longer able to reproduce this in git-master
Konsole 24.11.70

Please re-open if you can still reproduce the problem in that version. Thanks!