Commit Graph

103 Commits

Author SHA1 Message Date
Kurt Hindenburg
7e00edd516 Make sure pty device has right size before terminal process queries it.
Whenever TeminalDisplay is resized, konsole tells the underlying
pty device its new size by calling Pty::setWindowSize(). However,
current code can't guarantee when the terminal process starts and
queries the pty device about its size, the pty device already has the
right info. This has caused some long known bugs, such as #176902.

This patch tries to guarantee that important assumption. It currently
uses a hard-coded small delay, which works pretty well in practice
although not that elegant.

Patch by Jekyll Wu <adaptee@gmail.com>

I think this is better than leaving the situation as it is.  This may
be backported if no issues are found.
BUG: 173999
BUG: 176902
BUG: 203185
BUG: 229058
REVIEW: 102061
FIXED-IN: 4.8
2011-08-05 10:40:14 -04:00
Montel Laurent
b91f50015d Normalize signals/slots 2011-07-30 14:10:56 +02:00
Kurt Hindenburg
b8b3f23723 Correct non-zero status notification such that it works.
The non-zero notification was being displayed for zero exit codes.

Thanks again to Jekyll Wu (adaptee@gmail.com) for patch and research.
BUG: 221726
FIXED-IN: 2.8
2011-07-20 09:53:32 -04:00
Montel Laurent
a955ae6e36 Don't check pointer before to delete it 2011-04-21 13:37:01 +02:00
Kurt Hindenburg
acd507e1a5 Set correct focus in the "rename tab" dialog.
Currently, the OK button has the focus upon startup. After patch, the
user doesn't need to remember if they need to adjust the remote or
local title.

Patch by Sebastian Kühn

http://git.reviewboard.kde.org/r/100642/
2011-02-13 21:29:15 -05:00
Kurt Hindenburg
b216cb9daf In the tab title, for %D change the user's home path with a ~ if it starts at the
beginning.

FEATURE: 206316
FIXED-IN: 4.6

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1185589
2010-10-13 19:58:43 +00:00
Kurt Hindenburg
f212b944c7 Use kWarnings for error messages
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1148434
2010-07-10 16:44:45 +00:00
Kurt Hindenburg
3d052f909c Add 2 new dbus methods for setting tab title formats so that they are persistent.
Thanks to Andrea Solis for original patch.

FIXED_IN: 4.5
BUG: 183963

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1136726
2010-06-10 15:09:49 +00:00
Kurt Hindenburg
abacbc3ada Save character encoding to session management.
BUG: 221450

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1134480
2010-06-04 12:33:33 +00:00
Eli MacKenzie
2f6ec63377 Adds support for SHELL_SESSION_ID.
CCBUG:156563

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1125733
2010-05-12 06:15:41 +00:00
Kurt Hindenburg
bc3e902d65 Correct where new Hotspots are calculated upon resize.
CCBUG: 228443

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1097379
2010-03-01 04:10:55 +00:00
Kurt Hindenburg
926f4f085a Add some context for translators
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1086337
2010-02-06 23:08:09 +00:00
Friedrich W. H. Kossebau
1cf6ef9365 changed: made static const data symbols really static const
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1080302
2010-01-26 02:57:09 +00:00
Kurt Hindenburg
c227b186c4 Fix issue where 'Copy Input To' doesn't work for multiple windows.
Patch by Thomas Dreibholz

BUG: 218616

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1067166
2009-12-29 03:59:07 +00:00
Kurt Hindenburg
df31057755 On the command line expand ./ for -e only.
CCBUG: 202302

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1028021
2009-09-25 14:26:03 +00:00
Kurt Hindenburg
c45359a075 Allow relative program parameters on command line and profiles.
BUG: 202302

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1027909
2009-09-25 05:33:02 +00:00
Kurt Hindenburg
9f3e26e76f Update 'Copy Input To->' menu items.
Thanks to Thomas Dreibholz for patch.  I made a few minor alterations.

BUG: 168292
GUI

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1027898
2009-09-25 03:05:08 +00:00
Kurt Hindenburg
02713c707d Correct to US Spelling
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1017651
2009-08-31 03:32:14 +00:00
Kurt Hindenburg
2af04206c9 Allow Konsole's zmodem file transfers to work.
Thanks to Thomas Dreibholz <dreibh@iem.uni-due.de> for the patch.  I removed
some whitespace changes from his patch on reviewboard.

BUG: 200744

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1016847
2009-08-29 04:24:37 +00:00
Kurt Hindenburg
a17a48247f Expand ~ for working/initial directory; includes the command line and in profiles.
BUG: 183283

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=965328
2009-05-08 15:34:38 +00:00
Kurt Hindenburg
ac17e1eaaa remove old debugging output
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=957196
2009-04-21 15:10:38 +00:00
Kurt Hindenburg
b05607ee5f Implements the session portion of the dbus interface.
CCBUG: 169024

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=957189
2009-04-21 15:02:09 +00:00
Rahman Duran
9ec6d94a7b Implemented new TerminalInterfaceV2 functions.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=946379
2009-03-29 11:51:01 +00:00
Robert Knight
dd9df43b44 Remove emacs mode information from the bottom of some source files.
If this information is put anywhere it should be in a single file instead
of duplicated for each file.  In fact, it shouldn't be needed at all since
we have the same rules on tabs and tab sizes as most other parts of kdebase


svn path=/trunk/KDE/kdebase/apps/konsole/; revision=946369
2009-03-29 11:12:57 +00:00
Robert Knight
ef3e43e11d Initial implementation of session management in Konsole.
Patch from Stefan Becker <stefan.becker@nokia.com>

Thank-you very much Stefan!

CCBUG: 152761


svn path=/trunk/KDE/kdebase/apps/konsole/; revision=867323
2008-10-03 10:38:50 +00:00
Robert Knight
4bfb7abf81 Follow rename of Emulation::getErase()
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=864901
2008-09-25 21:35:08 +00:00
Robert Knight
c05cbc4792 Remove unused variable
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=864329
2008-09-24 14:12:15 +00:00
Robert Knight
956277c014 Convert tabs to 4 spaces to match kdelibs conventions. Previously
there was a mix of tabs and spaces for indentation.

CCMAIL:Stefan.Becker@nokia.com


svn path=/trunk/KDE/kdebase/apps/konsole/; revision=863326
2008-09-21 20:06:58 +00:00
Kurt Hindenburg
877abc9ec6 Change getenv to qgetenv for portable (ebn krazy)
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=846759
2008-08-14 03:55:59 +00:00
Robert Knight
a6f62f87d7 If a terminal process does not respond to SIGHUP (because it is running as root
for example), close the pty instead and wait for the process to exit.

CCBUG:165994

BACKPORT-4.0

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=832426
2008-07-14 16:31:37 +00:00
Robert Knight
3330cfe0ff Fix crash when closing a program which exited unexpectedly. _shellProcess->program()
may not be valid at this point, use Session::_program instead.

BACKPORT

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=832425
2008-07-14 16:31:32 +00:00
Robert Knight
d9f4c91486 Update pty window size when the image size is changed via escape codes
from the terminal.

CCBUG: 163782

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=819652
2008-06-11 17:20:44 +00:00
Robert Knight
73f5324561 Do not show flow control warning widget if terminal application (eg. Emacs) disables
flow control.  Check current terminal flow control settings when Ctrl+S is pressed and only 
show the warning if the warning is enabled in profile settings and Xon/Xoff is 
enabled in the terminal.

BUG: 162173
CCMAIL: jriddell@ubuntu.com


svn path=/trunk/KDE/kdebase/apps/konsole/; revision=808588
2008-05-16 23:59:16 +00:00
Rafał Miłecki
5aa053f08d Fix compilation warning: "suggest parentheses around && within ||"
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=802759
2008-04-30 14:06:06 +00:00
Robert Knight
c1a8b97490 Add new sessions to utmp.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=802428
2008-04-29 11:16:51 +00:00
Robert Knight
5d9997446e Update copyright year to 2008. Remove '(C)' from copyright lines.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=800631
2008-04-24 14:53:43 +00:00
Robert Knight
971a5315f9 Remove debugging messages.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=800628
2008-04-24 14:52:39 +00:00
Robert Knight
b93ed8ab63 Remove debugging messages.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=799804
2008-04-22 11:46:14 +00:00
Robert Knight
039d1c4f6f Support use of existing pty in embedded terminal via openTeletype(int fd) slot.
No new methods have been added to the TerminalInterface class in kdelibs to avoid breaking
binary compatibility so the slot must be invoked via QMetaObject::invokeMethod() for now.

See tests/PartTest.cpp

CCMAIL:jr@jriddell.org

Squashed commit of the following:

commit 0759e22dc26b7c1c28e0d8a9b0d245d909629237
Author: Robert Knight <robertknight@gmail.com>
Date:   Fri Apr 18 20:43:20 2008 +0100

    Adapt test to kdelibs changes.  Add a label to explain what the user should expect to see.

commit b67be2fd20178625f01f8f135751849082eddf04
Author: Robert Knight <robertknight@gmail.com>
Date:   Fri Apr 18 00:47:32 2008 +0100

    Export Pty, Session, KeyboardTranslator classes for use in tests.

commit 6dd28bf628fe1036c59f3383aba27ba98e23152c
Author: Robert Knight <robertknight@gmail.com>
Date:   Fri Apr 18 00:46:27 2008 +0100

    Build test

commit 0a9e1c9dc158f73e6bf9f7ef2fe7d4ea936a8066
Author: Robert Knight <robertknight@gmail.com>
Date:   Fri Apr 18 00:46:10 2008 +0100

    Remove temp file

commit 8e69bd56fef267ac0c31c989a4959453a8e3359e
Author: Robert Knight <robertknight@gmail.com>
Date:   Fri Apr 18 00:45:28 2008 +0100

    Add a test for using existing file descriptors with the Konsole part.

commit f1f5b8a7684e88db64769324496a5fa67dd4920b
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 18:36:14 2008 +0100

    Add support in the KPart to use an existing terminal rather than opening a new one.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=798661
2008-04-18 19:47:32 +00:00
Robert Knight
3ddffbd214 Re-implement 'Send Input to All' (now Edit -> Copy Input To...)
Improvements in the KDE 4 version:

- Input can be copied to all other sessions or only a subset of sessions,
  selection is via a filter-able list which appears when 'Copy Input To...' is clicked.
- Input can be sent from a tab in one window to a tab in another window
  (all sessions in all windows are displayed in the filter window)

BUG: 152072
BUG: 77682

Squashed commit of the following:

commit 3184e1958d3aa7e7574081df32814dbe44591c9e
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 19:24:22 2008 +0100

    Remove debugging messages.

commit 31afd9b2a3a327ca3e43deff47415de41a1ad74e
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 19:16:33 2008 +0100

    Copy input dialog.  Hide 'Number' column and header.  Show the check box in the title column.  Focus the search filter before showing the dialog.

commit 8c74e736d322e74d7af812a14500d748e748a224
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 19:03:59 2008 +0100

    Remove sessions from the internal checked/fixed sets when they are removed.  Fix crashes if sessions exited while SessionController was showing a dialog for that session.  Add QPointer<T> guards around the dialog exec() methods.

commit e4085069c2ff8cedb987639f50b73a3c679319f6
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 18:44:40 2008 +0100

    Remove sessions from the SessionGroup and SessionListModel when they terminate.

commit 29db3a3dd84f392ee333918e261bd6bcd75fd062
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 18:39:24 2008 +0100

    Use an extended rather than single selection in CopyInputDialog

commit 3f93507405053c84e09337225fa6e2a582776264
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:54:22 2008 +0100

    Copy Input Dialog:  Show tab text in the Title column.  Show clear button in filter line edit.

commit 0619f7ad72a1a346118a0174e5aee01ce94ddc52
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:40:07 2008 +0100

    Copy Input Dialog:  Add buttons to select and deselect all visible sessions.

commit 126afb3d394894a0325c5772fb32a25380932c44
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:23:07 2008 +0100

    Show the master session as checked and disabled.

commit c559bd5f5bcc59adecc3f29ee5b16200adb37b09
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:20:40 2008 +0100

    Create a SessionGroup in the SessionController when copyInputToAll() is called and use the CopyInputDialog to allow the user to choose which sessions the current one copies to.

commit 64c12e58a582a17b5cdeddcc8f9df7a89885f9e5
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:19:47 2008 +0100

    Display session list with check boxes and filter to select sessions to copy input to.  Show master session as a disabled, checked item.

commit 43eb5ccdfc768b42c5e650b6e56d1e1120ab5c5b
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:19:06 2008 +0100

    Add header data and Session* pointer to items in SessionListModel.

commit a8236a6658e1540a924aa6467dc90aeed346a0be
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:18:28 2008 +0100

    Remove connection to removed slot.

commit 03990fa244159b50152cc721a0fe4e403551d47c
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 17:17:54 2008 +0100

    Make SessionGroup take a QObject* parent argument in the constructor.

commit e2f91001c09a8422fb44ad58cf95f8dcba22c063
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 15:25:26 2008 +0100

    Add CopyInputDialog to build.

commit 3b33e1d6abdde56bbafd2bbd64c89c008a41d096
Author: Robert Knight <robertknight@gmail.com>
Date:   Sun Apr 13 14:32:36 2008 +0100

    Add header and implementation files for 'Copy Input To' dialog.

commit 9ebc36e3f09865f29702768cbb17279054e8cb4c
Author: Robert Knight <robertknight@gmail.com>
Date:   Thu Apr 10 07:04:48 2008 +0100

    Add a dialog for selecting sessions to copy input to.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=796545
2008-04-13 18:49:20 +00:00
Albert Astals Cid
444308fccd give the arguments to the i18n call
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=796408
2008-04-13 14:37:43 +00:00
Robert Knight
d063697599 Do not show warning on exit if the user closes the session via the 'Close Tab' action which will send SIGHUP to the terminal which will report a non-normal exit.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=788965
2008-03-23 00:17:57 +00:00
Robert Knight
5036d8cb00 Squashed commit of the following:
commit 99d61f9bdfe29347050162a5a675bb0c276bc1bf
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 20:45:45 2008 +0000

    Allow a normal frame around the table view in ManageProfilesDialog.  Works better with Oxygen style.

commit 7075de00d8cc88568e108e868e08d071d5aa7bcb
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 20:37:38 2008 +0000

    Change base class of ProfileItemDelegate from QItemDelegate to QStyledItemDelegate for better rendering.  Fix updates of favorite / non-favorite status in ManageProfilesDialog.  QVariant equality comparisons are not properly supported for custom types so QAbstractItemModel::match() has to be replaced with manual iteration through the rows.

commit 3baa3307473e037efd500ade7df37d2fd62c60d9
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 20:09:27 2008 +0000

    Remove unecessary deleteProfile() call.  Explicitly add new profiles to the SessionManager.  Mark the temporary profile in the EditProfileDialog as hidden.

commit 53d1e3515d3408c08ba4b019b5faceffae6b0f8a
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 20:02:28 2008 +0000

    Do not track deletion of temporary un-named profiles.

commit 55c69e15a4247319b0cff73691f072fef39684c9
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 20:01:25 2008 +0000

    Make SessionManager::addProfile() public.  Call it automatically in SessionManager::setFavorite() if the profile is not already known to the manager.  When a profile is deleted via SessionManager::deleteProfile() mark it as hidden so that it is not recreated on disk if later changed.  Add debugging in ~Profile to track deletion of profiles.

commit 7a028bac5846cd3689e3351ab139c6f372ca173e
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 19:41:22 2008 +0000

    Fix several signal/slot connections in ManageProfilesDialog after the SessionManager changes.

commit da7c7b4f939c17885cf0fbaa1fb93d2655021b83
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 19:36:57 2008 +0000

    Use a helper class to pop elements from recursion guard stack when a call to loadProfile() returns rather than requiring a manual call to recursionGuard.pop()

commit 14a993d15722ec5270de708154408896fd7418b8
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 19:12:20 2008 +0000

    Fix profiles not being loaded properly if their parent was a profile which had already been loaded.  Profile paths were not being taken off the recursion guard stack at one exit from loadProfile().

commit f946fc0cbde26cd816e3f1d172a5e5327ff3295b
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 19:01:06 2008 +0000

    Adapt Part to the SessionManager/Profile changes.

commit d3155ba0f6dc9ec0ca34a45b5787488c055dc4bf
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 18:55:05 2008 +0000

    Update MainWindow API documentation to reflect string key -> ref counted pointer change for profiles.

commit 5d546054c031ae6ee6915f2cc6bcf61dd4e03520
Author: Robert Knight <robertknight@gmail.com>
Date:   Sat Mar 22 18:53:16 2008 +0000

    Update SessionManager API documentation to reflect string key -> ref counted pointer change for profiles.

commit 856fdf37a5bd81711ff0db1b307b8736ef4ae34e
Author: Robert Knight <robertknight@gmail.com>
Date:   Thu Mar 20 23:43:53 2008 +0000

    Fix assert.  Fall back to current locale's codec if a null pointer is passed to Emulation::setCodec()

commit 127e894d076061b991934adf84256b651bf31724
Author: Robert Knight <robertknight@gmail.com>
Date:   Thu Mar 20 22:45:11 2008 +0000

    Replace string key for profiles with ref-counted profile pointer.

commit 53246e5bd4ffcec56ca0ff94730f9ef3946e3f4c
Author: Robert Knight <robertknight@gmail.com>
Date:   Thu Mar 20 20:50:17 2008 +0000

    First step towards removing string keys as a means to reference profiles.  Change Profile base class from QObject to QSharedData and replace all usage of Profile* with KSharedPtr<Profile>

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=788936
2008-03-22 21:06:59 +00:00
Robert Knight
ede5253a45 Do not print a warning if the shell exits with a non-zero exit code. Only print a warning if the program actually crashed. Non-zero exits happen frequently for shells whoose exit code is the exit code from the last command executed in them.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=788666
2008-03-22 03:35:22 +00:00
Robert Knight
02a3de575f Replace one remaining usage of \E escape sequence with \033.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=787846
2008-03-19 23:45:31 +00:00
Robert Knight
c0956d735f Change non-ISO escape sequence \E to \033.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=787748
2008-03-19 20:04:52 +00:00
Robert Knight
704e6004a7 Explain warnings.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=787747
2008-03-19 20:04:49 +00:00
Robert Knight
875ce3991e Display a warning message in the terminal in red if starting the session
fails because the binary does not exist or if the shell crashes or exits
with a non-zero status code.

In these cases, also prevent the tab from being closed automatically.

If the binary for the session cannot be found, display a warning and try
to fall back to $SHELL or as a last attempt, /bin/sh.  This should mean
that users should always be given a semi-functional basic environment
if their profiles get messed up, the shell program gets uninstalled etc.

BUG: 120322

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=787709
2008-03-19 17:13:14 +00:00
Robert Knight
3b552b6174 Add support for setting background and foreground colors of a session's displays
using the Xterm Operating System Controls escape sequences.

See the "Operating System Controls" section on this page:
http://rtfm.etla.org/xterm/ctlseq.html

Other colors and multiple color sequences are not supported.

xtermcontrol --fg=<color> --bg=<color> now work as expected.

In addition to standard color names ("green","blue","red") etc, Qt
also accepts SVG color names:

http://www.w3.org/TR/SVG/types.html#ColorKeywords

BUG: 155801

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=787355
2008-03-19 03:04:32 +00:00
Robert Knight
5166436617 Fall back to /bin/sh if neither the profile command nor the /bin/bash environment variable is set.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=764376
2008-01-21 15:59:32 +00:00