Bug 175755 - "Copy Input" selection list does not expand %w or %# macros.
Summary: "Copy Input" selection list does not expand %w or %# macros.
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 307098 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-21 13:54 UTC by Timothy Hinchcliffe
Modified: 2012-09-20 12:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hinchcliffe 2008-11-21 13:54:47 UTC
Version:           2.1 (using 4.1.2 (KDE 4.1.2), 4.1.2-5.fc9 Fedora)
Compiler:          gcc
OS:                Linux (i686) release 2.6.27.5-41.fc9.i686

The default window/tab title for tabs is "%n %d" which is correctly expanded in the "Copy Input" selection list which is displayed when you select "Edit"|"Copy Input To...". However other macros such as "%w" ("Window Title Set by Shell") and "%#" ("Session number") are not expanded making select of the appropriate window(s) to copy input to very difficult if you have changed them.
Note that all macros expand correctly on both the tab name and the window title.

This behaviour can be tested either by changing the string via "Edit"|"Rename tab..." or changing the default in the profile (and then start a new session of that profile).

Expected behaviour is that at least "%#" should expand the same way "%n" and "%d" do, and preferable "%w" is expanded too.
Comment 1 Fredrik Larsson 2009-02-06 16:43:49 UTC
Version: 2.2 (Using KDE 4.2.00 (KDE 4.2.0))
Compiler: gcc
OS: Gentoo Linux (x86_64) release 2.6.28-gentoo-r1

This behavior can be confirmed in Konsole v2.2 on KDE4.2.0 as well.
Comment 2 John B 2010-06-18 04:14:01 UTC
This is broken for me as well in Konsole 2.3.2 (KDE 4.3.2)...not too easy to choose windows when there are 20 items, all called "%w".  :)

As with Timothy, my expansion also works as expected in the tabs/titlebar.
Comment 3 Fredrik Larsson 2010-06-18 13:16:34 UTC
Version: 2.4.3 (Using KDE 4.4.3)
Compiler: gcc
OS: Gentoo Linux (x86_64) release 2.6.34-gentoo

Behavior confirmed in version 2.4.3 on KDE 4.4.3
Comment 4 Jekyll Wu 2011-10-21 19:20:17 UTC
Git commit 1c1981501b6e3bcd433840bf36f7851f06772322 by Jekyll Wu.
Committed on 21/10/2011 at 21:09.
Pushed by jekyllwu into branch 'master'.

Ensure %w and %# are also expaned in the 'Copy input' dialog

The fix is quite simple. Just move the existing code for expanding
%# and %w into Session::getDynamicTitle(), where all other tab title
formatters are expanded. That also makes the code simple and natural.

BUG: 175755
FIXED-IN:4.8

M  +8    -0    src/Session.cpp
M  +0    -8    src/SessionController.cpp

http://commits.kde.org/konsole/1c1981501b6e3bcd433840bf36f7851f06772322
Comment 5 Jekyll Wu 2011-11-29 06:17:09 UTC
Git commit 36bd1828f373a1a04b8f9d740ca014722ca0597a by Jekyll Wu.
Committed on 29/11/2011 at 06:49.
Pushed by jekyllwu into branch 'master'.

Revert "Ensure %w and %# are also expaned in the 'Copy input' dialog"

That fix is not good enough because it makes '%w' being updated only
after keystroke instead of immediately . The issue of updating title is
actually a little more complicated than I have understood.

Revert it because the regression should influence more users than the
fixed problem does. Need to spend more time to find a better fix.

CCBUG: 175755
CCBUG: 287536

This reverts commit 1c1981501b6e3bcd433840bf36f7851f06772322.

M  +0    -8    src/Session.cpp
M  +8    -0    src/SessionController.cpp

http://commits.kde.org/konsole/36bd1828f373a1a04b8f9d740ca014722ca0597a
Comment 6 Kurt Hindenburg 2012-07-28 14:23:04 UTC
Git commit f43dd28d66b2a78157f1b5d14727f8542be9126a by Kurt Hindenburg.
Committed on 28/07/2012 at 16:19.
Pushed by hindenburg into branch 'master'.

Expand %# %w in the "Copy Input To" dialog session list.

Duplicate the code in SessionController.cpp to expand %# %w in the
copy input dialog.  This is not the ideal solution but it not trivial
to fix w/ all the tab/window titles issues in Konsole.
FIXED-IN: 4.10

M  +13   -3    src/SessionListModel.cpp

http://commits.kde.org/konsole/f43dd28d66b2a78157f1b5d14727f8542be9126a
Comment 7 Kurt Hindenburg 2012-08-21 14:17:34 UTC
Git commit 169fd67e40477fe8a3c58b8dca5ce79cc0545134 by Kurt Hindenburg.
Committed on 28/07/2012 at 16:19.
Pushed by hindenburg into branch 'KDE/4.9'.

Expand %# %w in the "Copy Input To" dialog session list.

Duplicate the code in SessionController.cpp to expand %# %w in the
copy input dialog.  This is not the ideal solution but it not trivial
to fix w/ all the tab/window titles issues in Konsole.
FIXED-IN: 4.10
(cherry picked from commit f43dd28d66b2a78157f1b5d14727f8542be9126a)

M  +13   -3    src/SessionListModel.cpp

http://commits.kde.org/konsole/169fd67e40477fe8a3c58b8dca5ce79cc0545134
Comment 8 Jekyll Wu 2012-09-20 12:38:50 UTC
*** Bug 307098 has been marked as a duplicate of this bug. ***