[konsole] [Bug 487896] Konsole –tabs-from-file opens additional empty tab

John B bugzilla_noreply at kde.org
Wed Mar 5 01:11:32 GMT 2025


https://bugs.kde.org/show_bug.cgi?id=487896

John B <john+kde_org at daaave.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john+kde_org at daaave.org

--- Comment #7 from John B <john+kde_org at daaave.org> ---
Hopefully this isn't too off-topic since it doesn't solve the problem or
provide a much better workaround than what's already been said, but maybe the
extra context will inspire someone...and as a user who'd like this fixed (but
also agree it's not a big deal) that's something.  :)

I poked at it a bit and it's not that Konsole is just opening an extra tab with
your shell, it's that it's opening the "initial" 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 "General > Command" of that profile, change the shell to
`/usr/bin/vim`, and
3. ...launch 'konsole --profile tabsfromfile --tabs-from-file
~/.local/share/konsole/mytabs.konsoletabs`

...then the "extra tab" would be a Vim instance rather than a shell.

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

1. Make a new Konsole profile that'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 "${1}-firsttab" --tabs-from-file
"${HOME}/.local/share/konsole/${1}-othertabs.konsoletabs"
```

If you _definitely do_ want everything in the tabs file (maybe it's in version
control?), you can still create a "tabsfromfile" profile, with the command set
to "/bin/true"; Konsole will still open that tab but it'll blip in and out
immediately (unless you'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's command that way (don't forget that `-e`
always has to come last on the command line).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list