<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>487896</bug_id>
          
          <creation_ts>2024-06-01 19:07:58 +0000</creation_ts>
          <short_desc>Konsole –tabs-from-file opens additional empty tab</short_desc>
          <delta_ts>2025-12-19 15:40:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>konsole</product>
          <component>tabbar</component>
          <version>master</version>
          <rep_platform>Kubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>pizza</reporter>
          <assigned_to name="Konsole Bugs">konsole-bugs-null</assigned_to>
          <cc>baron</cc>
    
    <cc>john+kde_org</cc>
    
    <cc>KDE</cc>
    
    <cc>kdedev</cc>
    
    <cc>wenzezlaus</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2323864</commentid>
    <comment_count>0</comment_count>
    <who name="">pizza</who>
    <bug_when>2024-06-01 19:07:58 +0000</bug_when>
    <thetext>SUMMARY
When using &apos;–tabs-from-file&apos; in Konsole, not only the expected tabs configured in the supplied file are opened but an additional empty tab with a regular prompt as well.

STEPS TO REPRODUCE
1. Create a simple text file suitable for `–tabs-from-file` containing pre-configured tabs
2. Start konsole pointing `–tabs-from-file` to that text file

OBSERVED RESULT
For n configured tabs, Konsole always opens n+1 tabs, i.e. one additional empty tab not configured in the file.

EXPECTED RESULT
Only the configured tabs (as defined in the file supplied to `–tabs-from-file`) should open.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2324081</commentid>
    <comment_count>1</comment_count>
    <who name="Vence">wenzezlaus</who>
    <bug_when>2024-06-03 07:44:02 +0000</bug_when>
    <thetext>Confirmed
Arch Linux, Plasma 6.0.5, konsole 24.05.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2324199</commentid>
    <comment_count>2</comment_count>
    <who name="Vence">wenzezlaus</who>
    <bug_when>2024-06-03 15:14:11 +0000</bug_when>
    <thetext>As a workaround, use command 

konsole --tabs-from-file `path-to-tabs-file&apos; -e &apos;bash -c exit&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2324465</commentid>
    <comment_count>3</comment_count>
    <who name="">pizza</who>
    <bug_when>2024-06-04 11:47:49 +0000</bug_when>
    <thetext>(In reply to Vence from comment #2)
&gt; As a workaround, use command 
&gt; 
&gt; konsole --tabs-from-file `path-to-tabs-file&apos; -e &apos;bash -c exit&apos;

Thank you for confirming and supplying a workaround! In my Kubuntu 22.04, however, appending the exit command still opens the extra tab and also leaves it open, albeit without the prompt being active anymore. So the &apos;exit&apos; does succeed in ending the shell session but (at least on my Konsole 21.12.3) the tab does not automatically close, so I am still stuck at n+1 tabs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2324880</commentid>
    <comment_count>4</comment_count>
    <who name="Kurt Hindenburg">khindenburg</who>
    <bug_when>2024-06-05 23:14:02 +0000</bug_when>
    <thetext>This is a known issue from the start - it wasn&apos;t a big deal so wasn&apos;t fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2325198</commentid>
    <comment_count>5</comment_count>
    <who name="Kurt Hindenburg">khindenburg</who>
    <bug_when>2024-06-06 23:08:01 +0000</bug_when>
    <thetext>*** Bug 450018 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2325535</commentid>
    <comment_count>6</comment_count>
    <who name="TraceyC">kdedev</who>
    <bug_when>2024-06-07 18:39:27 +0000</bug_when>
    <thetext>Marking confirmed since its been experienced by multiple users</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2404768</commentid>
    <comment_count>7</comment_count>
    <who name="John">john+kde_org</who>
    <bug_when>2025-03-05 01:11:32 +0000</bug_when>
    <thetext>Hopefully this isn&apos;t too off-topic since it doesn&apos;t solve the problem or provide a much better workaround than what&apos;s already been said, but maybe the extra context will inspire someone...and as a user who&apos;d like this fixed (but also agree it&apos;s not a big deal) that&apos;s something.  :)

I poked at it a bit and it&apos;s not that Konsole is just opening an extra tab with your shell, it&apos;s that it&apos;s opening the &quot;initial&quot; tab from its profile configuration, then adding the tabs from the tabs file.  For example, if you were to:

1. ...create a new Konsole profile called `tabsfromfile`, and
2. ...in &quot;General &gt; Command&quot; of that profile, change the shell to `/usr/bin/vim`, and
3. ...launch &apos;konsole --profile tabsfromfile --tabs-from-file ~/.local/share/konsole/mytabs.konsoletabs`

...then the &quot;extra tab&quot; would be a Vim instance rather than a shell.

So I guess one workaround that might work well if you&apos;re not bothered too much by the fact that you&apos;re not doing everything in the tabs file:

1. Make a new Konsole profile that&apos;s set up to run one of your desired tabs (configure the command accordingly, etc.)
2. Set up your tabs file to create all the _other_ tabs
3. Launch something like `konsole --profile first-tab --tabs-from-file ~/.local/share/konsole/other-tabs.konsoletabs`

In fact, if you do this a lot you could create a shell script/function called `konsole-tabs` with something like this (and maybe some other logic wrapped around it); then after creating each appropriate profile and tabs file, just run `konsole-tabs mytabs` and such.

```sh
konsole --profile &quot;${1}-firsttab&quot; --tabs-from-file &quot;${HOME}/.local/share/konsole/${1}-othertabs.konsoletabs&quot;
```

If you _definitely do_ want everything in the tabs file (maybe it&apos;s in version control?), you can still create a &quot;tabsfromfile&quot; profile, with the command set to &quot;/bin/true&quot;; Konsole will still open that tab but it&apos;ll blip in and out immediately (unless you&apos;re using `--noclose`, heh).

The other alternative -- as others have said -- is just something like:

```sh
konsole --tabs-from-file ~/.local/share/konsole/mytabs.konsoletabs -e /bin/true
```

...and replace the initial tab&apos;s command that way (don&apos;t forget that `-e` always has to come last on the command line).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>