Bug 315581 - Setting terminal title with newline character print unexpected newline to the terminal.
Summary: Setting terminal title with newline character print unexpected newline to the...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: 2.10
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-21 15:37 UTC by Yichao Yu
Modified: 2018-05-24 12:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 18.08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yichao Yu 2013-02-21 15:37:30 UTC
I set the terminal title according to my current command line, which sometimes include newline in it. In konsole, I always get several annoy blank lines with multi-line command (for loops etc.). The problem turns out to be the newline's (not any other characters) in the terminal title I set got unexpectedly echo back to the terminal.

This doesn't happen in vte{2,3}, xterm, so should be a bug of konsole.


Reproducible: Always

Steps to Reproduce:
1. run command `env echo -e 'j\e]2;\n\aj'` in konsole (use `env echo` to avoid any shell-specific features of builtin echo's.)
2.
3.
Actual Results:  
print "jj"

Expected Results:  
print "j
j"
Comment 1 Yichao Yu 2013-02-21 15:38:32 UTC
Oh I flipped the expected and actual result................

SHOULD BE:

Actual Results:  
print "j
j"

Expected Results:  
print "jj"
Comment 2 Kurt Hindenburg 2013-02-24 19:23:12 UTC
Anything between the \e]2; and the \a (007) should not be outputted to the screen.
Comment 3 Ashish Bansal 2014-10-12 18:39:18 UTC
I think this bug has already been resolved  as I am getting Expected Results!
Comment 4 Ashish Bansal 2014-10-12 18:43:07 UTC
(In reply to Ashish Bansal from comment #3)
> I think this bug has already been resolved  as I am getting Expected Results!

Oh, sorry I didn't read the second post !!
Comment 5 Kurt Hindenburg 2018-05-24 12:34:55 UTC
Git commit d547d1d177bd0582df95a5d50dc3b37e0636748e by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 24/05/2018 at 12:34.
Pushed by hindenburg into branch 'master'.

Ignore control characters in the text part of Xpe "ESC]" sequences

Summary:
Ignore control characters in the text part of Xpe (OSC, Operating System
Control) of the form "ESC]Pn;Pt\a" escape sequences; this matches what
XTerm docs say.

If userTitle is an empty string, set the window title to a blank space
when showWindowTitleOnTitleBar is enabled; basically if the user sets
the title to an empty string, leave it as-is.
FIXED-IN: 18.08

Test Plan:
- unset PROMPT_COMMAND, in case the shell is configured to set the
   window title via that variable
- Make sure "Show window title on the title bar" is enabled
- Execute:
$ /usr/bin/echo -e 'j\e]2;\n\aj'
- The window title is changed to the tab title text; and the output
    looks like this:
j
j

- Apply the diff, build, and try again, the window title should be
   set to an empty string (really a blank space), and the output
   should look like:
jj

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13078

M  +6    -3    src/MainWindow.cpp
M  +6    -0    src/Vt102Emulation.cpp

https://commits.kde.org/konsole/d547d1d177bd0582df95a5d50dc3b37e0636748e