Commit graph

2010 commits

Author SHA1 Message Date
Anirudh Rayabharam 2d4eca7f4f Added support for DECSCUSR sequences (#941)
* Falling back to legacy cursor for higher values of CursorStyle

Co-Authored-By: Michael Niksa <miniksa@microsoft.com>
2019-05-23 10:44:27 -07:00
Ilya Shipitsin 547cba968c fix couple of null pointer dereferences (#927)
found by cppcheck

[src/propsheet/OptionsPage.cpp:216] -> [src/propsheet/OptionsPage.cpp:242]: (warning) Either the condition 'lParam' is redundant or there is possible null pointer dereference: pshn.
[src/propsheet/TerminalPage.cpp:352] -> [src/propsheet/TerminalPage.cpp:378]: (warning) Either the condition 'lParam' is redundant or there is possible null pointer dereference: pshn.
2019-05-23 12:42:39 -05:00
Dustin L. Howett (MSFT) 798912c2f4
Enable C++/WinRT Optimizations for local component builds (#949)
Fixes #945.
2019-05-23 10:36:29 -07:00
Eric Budai 06a5583c86 Fix a bunch of static analysis issues (#553)
* static analysis fixes
* using C++ style casts
* explicit delete changed to reset(nullptr)
* fix for null apiMsg.OtherId during tracing in Compare()
* changed INVALID_ID macro to constexpr
* properly handle null ReplyMsg in ConsoleIoThread()
* Fixed wrong static_cast for State.InputBuffer
* compensate for null reply message to fix deref problem of ReplyMsg in srvinit.cpp by changing signature in DeviceComm.h
2019-05-23 10:35:30 -07:00
Maks Naumov 82e75ce3e2 Utf8ToWideCharParser: Fix memory leak in case of error (#836) 2019-05-23 11:05:57 -05:00
Juris Bogusevs 5ec7c0325e Closing the tab shifts focus to the right (#767)
* On closing the tab - the focus is shifted to the right.
2019-05-23 08:24:40 -05:00
Dustin L. Howett bbbd3e0323 Use the right Windows PowerShell icon
Fixes #952.
2019-05-22 22:15:02 -07:00
Shawn Walker-Salas 1d9cdb3d31 set identifying environment variable for new connections (#897)
* set identifying environment variable for new connections

Set a new 'WT_SESSION' environment variable when creating new terminal
connections to allow shells to detect a unique Windows Terminal session.
The value of the variable is a stringified GUID as returned by
CoCreateGuid.

How verified:
- "razzle" & vs debug build
- runut
- manual inspection

* * use winrt::guid type for connection guid
* use Utils::GuidToString for guid stringification
* expose guid parameter in ITerminalConnection idl

* - poke guid through ITerminalConnection
- misc. review fixes
- throw if CreateConPty fails in ConhostConnection::Start
- apply [[nodiscard]] and noexcept in various places

* - simplify environment variable extraction in UpdateEnvironmentMapW

* - use Utils::CreateGuid instead of CoCreateGuid in ConHostConnection()
2019-05-22 13:24:22 -07:00
Dustin L. Howett (MSFT) 8c3af2d066
Add default icons for the default profiles (#934)
This commit introduces a handful of default icons whose paths will be
emitted into the default profiles.

Icons are named after the profile GUIDs, which for the default profiles
are stable v5 UUIDs based on the name of the profile. The plan is that
we'll never have a duplicate default profile, and if the user wants to
duplicate it they'll need to issue it a new GUID.

Eventually, when icons can be inserted through the settings UI, we can
keep the GUID name (to unique them among all icons for all profiles) and
move them into ms-appdata:///roaming/.

The currently included icons are named for the following profiles:

"cmd" `{0caa0dad-35be-5f56-a8ff-afceeeaa6101}`
"PowerShell Core" `{574e775e-4f2a-5b96-ac1e-a2962a402336}`
"Windows PowerShell" `{61c54bbd-c2c6-5271-96e7-009a87ff44bf}`
"WSL" `{9acb9455-ca41-5af7-950f-6bca1bc9722f}`

The PowerShell profile names aren't being used yet, but this is in
preparation for #918 merging.

Fixes #933.
2019-05-22 13:03:10 -07:00
Tim Heuer e9a3d16286 Adding auto-UI shortcuts to menu based on keymappings (#924)
* Adding vsconfig file for VS2019 help to prompt for missing components requried.

* Adding a keybinding for launching the settings.  Suggested fix for #683

* Modified to comma per PR feedback

* Implements 791 for profile and settings shortcuts (most frequent and have shortcuts)

* Quick change for consistency (missed in first checkin due to using ENUM) on using 'Ctrl' instead of 'Control'

* Adding UI shortcut generation to new keybinding mappings.  Resolving #791

* Making a few changes on reviewer feedback for shortcut UI.

* Additional reviewer feedback on variable name change (not a member var)
2019-05-22 15:01:33 -05:00
Carlos Zamora 6a79025027 Bugfix: padding offsets selection (#906)
Closes #660.
2019-05-22 09:34:20 -07:00
Mikael Olenfalk 6c7dfd2ce4 Use wstring_view for constants instead of wstring (#925) 2019-05-21 15:39:26 -07:00
Dreamer db637021fd Fix memory leak, use unique_ptr for Core::Terminal object (#914) 2019-05-21 14:07:03 -07:00
Dustin L. Howett (MSFT) 8da6737d64
Switch to v5 UUIDs as profile GUIDs for the default profiles (#913)
This commit switches the GUIDs for default profiles from being randomly generated to being version 5 UUIDs. More info in #870.

## PR Checklist
* [x] Closes #870
* [x] CLA signed
* [x] Tests added/passed
* [x] Requires documentation to be updated (#883)
* [x] I've discussed this with core contributors already.

## Detailed Description of the Pull Request / Additional comments
This commit has a number of changes that seem ancillary, but they're general goodness. Let me explain:

* I've added a whole new Types test library with only two tests in
* Since UUIDv5 generation requires SHA1, we needed to take a dependency on bcrypt
* I honestly don't think we should have to link bcrypt in conhost, but LTO should take care of that
  * I considered adding a new Terminal-specific Utils/Types library, but that seemed like a waste
* The best way to link bcrypt turned out to be in line with a discussion @miniksa and I had, where we decided we both love APISets and think that the console should link against them exclusively... so I've added `onecore_apiset.lib` to the front of the link line, where it will deflect the linker away from most of the other libs automagically.

```
StartGroup: UuidTests::TestV5UuidU8String
Verify: AreEqual(uuidExpected, uuidActual)
EndGroup: UuidTests::TestV5UuidU8String [Passed]

StartGroup: UuidTests::TestV5UuidU16String
Verify: AreEqual(uuidExpected, uuidActual)
EndGroup: UuidTests::TestV5UuidU16String [Passed]
```
2019-05-21 13:29:16 -07:00
Richard Yu fd2fb07bcf Remove ATL dependencies (#676) (#719)
* Remove CComBSTR dependency.
* Replace CStructureArray with std::vector.
* Remove CComPtr dependency.
* Add try blocks.
* Remove CString dependency.
* Add comments for string helper functions.
* Remove CComAllocator dependency.

Fixes #676.
2019-05-21 10:32:43 -07:00
Mike Griese 29e380824f
Support remapping keybindings (#748)
* Add support for serializing keybindings
2019-05-21 09:26:04 -05:00
Hermès BÉLUSCA - MAÏTO acabbe0459 Fix it's versus its typo. (#911) 2019-05-21 06:15:44 +00:00
Dustin L. Howett (MSFT) dd9bc6ee45
inbox PR 3285709: Add chafa resource into the DLL built by Windows Razzle (#912)
[Git2Git] Merged PR 3285709: Add chafa resource into the DLL built by Windows Razzle #21439265
2019-05-20 17:06:21 -07:00
Gabriele 0060614173 Added requestedTheme option into terminal settings (#710)
* added requestedTheme option into terminal settings

* fix tabs to 4 spaces

* removed newline

* fix option requestedTheme not shown in profiles.json

* fix indentation

* fix indentation part 2

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
2019-05-20 20:54:19 +00:00
Oscar Calvo 37ea2dce48 Simplify DPI logic (#829)
* Simply DPI logic

* Apply PR comments

* Update src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>

* Add comments

* Update src/cascadia/WindowsTerminal/BaseWindow.h

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>

* Apply PR feedback
2019-05-20 19:49:28 +00:00
Mitchell Blowey 9f4ad6d1ce Fix #670: Terminal selects a char when bringing window to foreground (#856)
* Added focus tracking to TermControl to prevent clicks which refocus the terminal window from selecting text.

* Moved open brace to a new line per repo code style.

* Moved the TermControl's _MouseClickHandler's focus check into the Mouse specific block of code. This lets any touch and drag events scroll the terminal's contents.

Fixes #670.
2019-05-20 12:05:58 -07:00
Michael Ratanapintha 7533b31cbd Fix #453: Setting historySize=32767 causes WindowsTerminal to hang (#843)
* fix for historySize=32767 hang (except for historySize=0 case); tests still in progress

* tests run and almost pass - failure is a real bug in my change

* fixed bug that caused tests to fail, but it seems another bug causes the app to crash with a zero row count

* fix the additional bug (at a higher layer) mentioned in previous commit description

* Fix chk build assertion failures in new tests

It seems C++/WinRT doesn't like it when you implement a Windows Runtime
interface but then create instances of the implementing class
with function-call lifetime (aka stack allocation). That makes sense
given that WinRT objects are COM objects, but in my defense I was following
this example where they are just fine instantiating the `App` object
on the stack:
https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/author-apis#if-youre-not-authoring-a-runtime-class

* tabs to spaces

* CR feedback

* fix minor CR feedback (incorrect test log message)
2019-05-18 03:57:34 +00:00
Bartosz Brachaczek 73ad742c12 Fix signatures of some callback functions (#871)
* Fix signatures of callback functions

* Fix calling conventions of callback functions

* Remove now-unnecessary casts of pointers to callback functions
2019-05-17 20:32:51 +00:00
Mario Kneidinger fd98145af2 Delete the keybinding for NewTabProfile9 and SwitchToTab9 (#831)
* Deleted keybinding for NewTabProfile0

* Readded NewTabProfile9 with unbounded shortcut

* Untabify

* Deleted NewTabProfile9 and SwitchToTab9
2019-05-17 15:52:01 +00:00
ChristianBoehm 2b41fad198 fixed on build error xcopy on localized machines (#847)
* fixed on build error xcopy on localized machines

echo ( f | xcopy ) will not work, can get around with putting an '*' at the end, xcopy will treat then as file. This solutions builds 
fine on DE German machine.

* removed echo | f it's not longer needed 

set cmd switch to capital /Y from lower
2019-05-17 00:48:00 +00:00
Dustin Howett 723ff47789 inbox: Reflect Windows inbox changes from 20190516 2019-05-16 16:21:33 -07:00
Fergal Reilly 3a27b29afc Amend Color array to typed values (#742)
* Amend Color array to typed values

* Re-add the original deserialization code.

* Re-added original deserialization

* Update comment spacing

Co-Authored-By: Michael Niksa <miniksa@microsoft.com>

* Replace tabs with spaces

* Replace array definition and update for loops.

* swapped _table calls to use .at()
2019-05-15 11:12:00 -07:00
Kapperchino 781d779b37 Added Keybindings for go up and go down page (#747)
* added keybindings

* untabfied the files

* fixed spacing issues and renamed termheight

* changed function names and other improvements

* made some auto variables const auto

* fixed tabs

* another try for the broken spacing
2019-05-15 08:21:14 -05:00
woachk bc69d1a99a Changes to be able to quit the application via exit inside a CLI prompt. (#746)
* Changes to be able to quit the application via exit inside a CLI prompt.
2019-05-15 07:22:16 -05:00
Dustin L. Howett (MSFT) 507d787fe8
inbox: reflect incoming changes from Windows 2019-05-14 16:16:43 -07:00
fghzxm ad27906db7 Convert copy to move (#717)
This commit converts 3 spots of copy construction into move
construction.

`return data` was not converted to a move because it should be easily
RVO'able.

Signed-off-by: Fred Miller <fghzxm@outlook.com>
2019-05-14 15:05:07 -07:00
Gil Mishal ea5270e563 added quotes to commands (#785)
thanks!
2019-05-14 14:27:39 -07:00
Mike Griese b5eeddfb0f Change the Feedback link to take you to github (#789)
Fixes #787.

  Considering we're just duping all feedback hub issues to github, lets cut out
  the middleman and take them straight here.
2019-05-14 13:16:40 -07:00
Keith Hill 71229239d4 Add one half color schemes (#466)
* Add One Half Dark & Light color schemes

* WIP: Add One Half Dark/Lite schemes to settings

* Address PR feedback - use gsl::narrow()

* Fix reversed OneHalfLight fg/bg colors

Added in customized colortool scheme colors for last 8 colors
2019-05-14 11:01:15 -07:00
Hao ef8e20af51 fix tab control and tabs is not synced after focused tab is removed (#737)
* trim duplicated github627

* fix tab control and tabs is not synced after focused tab is removed
2019-05-14 08:14:23 -05:00
David Teresi 8c177fab4f Add cursor blinking (#686)
It even respects the user's cursor blink speed setting!
2019-05-13 18:25:54 -07:00
pythias 2c1ab620bf Tab to spaces (#578)
* tab to spaces

* change tab size to 4.
2019-05-13 18:06:36 -07:00
Tim Heuer 04c7b944bd Adding keymapping for access to Settings (#684)
This commit adds the keychord Ctrl+Comma, which launches settings.
2019-05-13 18:02:06 -07:00
Malcolm Smith c2ee6277f8 Fix downlevel support for traditional console (#562) 2019-05-13 16:10:46 -07:00
Mario Kneidinger aeef340bdc Fixed duplicate line in TermControl (#732) (#739)
* Fixed duplicate line in TermControl #732

* Deleted lines, because values were unnecessarily set to default values.
2019-05-13 09:11:31 -07:00
That's My Face 9ba3a53b4b Fixed typo (#723) 2019-05-13 08:59:56 -05:00
Ghosty141 1e478ae99d Bugfix: The opacity of the text background color was set to 0.9 (#677) (#688) 2019-05-12 19:27:16 -05:00
fghzxm 6088134832 Improve startingDirectory functionality (#604)
* Improve `startingDirectory` functionality

This commit adds the `startingDirectory` property to the default-created
`cmd` and `powershell` profiles, with the default value
`%HOMEDRIVE%%HOMEPATH%`.

Signed-off-by: Fred Miller <fghzxm@outlook.com>

* Use %USERPROFILE% to replace %HOMEDRIVE%%HOMEPATH%

This commit changes `%USERPROFILE%` in the default profiles to
`%HOMEDRIVE%%HOMEPATH%`.

https://stackoverflow.com/posts/36392591/revisions says `%USERPROFILE%`
is better than `%HOMEDRIVE%%HOMEPATH%`, so changed it.

Signed-off-by: Fred Miller <fghzxm@outlook.com>

* Improve `startingDirectory` functionality

This commit adds the `startingDirectory` property to the default-created
`cmd` and `powershell` profiles, with the default value
`%HOMEDRIVE%%HOMEPATH%`.

Signed-off-by: Fred Miller <fghzxm@outlook.com>

* Use %USERPROFILE% to replace %HOMEDRIVE%%HOMEPATH%

This commit changes `%USERPROFILE%` in the default profiles to
`%HOMEDRIVE%%HOMEPATH%`.

https://stackoverflow.com/posts/36392591/revisions says `%USERPROFILE%`
is better than `%HOMEDRIVE%%HOMEPATH%`, so changed it.

Signed-off-by: Fred Miller <fghzxm@outlook.com>

* Consolidate constant

Refer to the externally defined constant in code.

Signed-off-by: Fred Miller <fghzxm@outlook.com>
2019-05-11 00:02:28 -07:00
Carlos Zamora bf460ab7fe Bugfix: don't allow closing last tab with middle click (#648)
* Bugfix: don't allow closing last tab with middle click
(Also add a few of the TODOs for similar areas)

* Replaced MSFT TODO with GitHub TODO
2019-05-10 15:11:23 -07:00
Matthew 5c707032a7 Make powershell the default profile (#639)
* Make powershell the default profile

Sets powershell as the default profile.

* Apply suggestions from code review

Co-Authored-By: Gabriel <gabriel@potter.fr>

* Update src/cascadia/TerminalApp/CascadiaSettings.cpp

Co-Authored-By: Gabriel <gabriel@potter.fr>

* Change profile order
2019-05-10 15:09:22 -07:00
Dustin L. Howett (MSFT) 660d31ac52
Add a dev manifest, which will be used by default (#558)
* Add a dev manifest, which will be used by default

To build a package named Microsoft.WindowsTerminal, you must build with
/p:WindowsTerminalReleaseBuild=true. This is to improve the SxS
developer/user scenario.

* Change dev manifest version to 0.0.1.0.
2019-05-10 11:56:06 -07:00
Carlos Zamora 644cd3ec6c
Bugfix: ESC didn't clear selection (except CMD) (#647)
* Bugfix: ESC didn't clear selection (except CMD)

* Bugfix: ESC didn't clear selection - moved TriggerSelection() to ClearSelection()
2019-05-10 11:16:59 -07:00
Artem Chernousov 99555ef9e9 Check null pointer before fclose (#586)
* Check null pointer before fclose, because fclose(NULL) will lead to undefined behavior

* Update main.cpp

Cast to one code style

* Update main.cpp

Remove redundant ==
2019-05-10 11:02:24 -07:00
Hao f74a9d3e0b add shortcut alt-* for select tab (#623)
* add shortcut alt-* for select tab

* all right, 0 for 10th
2019-05-10 09:48:36 -07:00
何智权 5dc7d0e843 close one tab by press ctrl-w and hide the bar (#628)
close one tab by press ctrl-w and hide the bar

fix #614
2019-05-09 12:32:57 -05:00
lstefano71 32f4f7133c make closeOnExit: true the default (#599)
* make closeOnExit: true the default

* another very similar instance of _closeOnExit
2019-05-09 09:17:33 -05:00
Samuel Kelemen 5a8e746d82 shared: Fix some Spelling issues in InputStateMachine (#588) 2019-05-08 21:35:30 -07:00
Hermès BÉLUSCA - MAÏTO 599a8dff0f Fix casts warnings. (#509) 2019-05-07 12:08:26 -07:00
Aaron 58ec47236d Fix build errors in VS2019 (#449) 2019-05-07 10:59:33 -05:00
Lorenz Nickel 1c345515b8 fix: replaced outdated url (#515)
http://colororacle.cartography.ch/ moved to https://colororacle.org/
2019-05-07 10:30:14 -05:00
Dustin Howett 23f85d01f0 Merge https://github.com/Microsoft/Console into master 2019-05-02 17:34:28 -07:00
Dustin Howett 4ab4051f63 Merged PR 3219702: Fix elevation by putting Markup & App in the manifest
Related work items: #21424135
2019-05-02 22:47:33 +00:00
Michael Niksa 87e85603b9 Merged PR 3215853: Fix spacing/layout for block characters and many retroactively-recategorized emoji (and more!)
This encompasses a handful of problems with column counting.

The Terminal project didn't set a fallback column counter. Oops. I've fixed this to use the `DxEngine` as the fallback.

The `DxEngine` didn't implement its fallback method. Oops. I've fixed this to use the `CustomTextLayout` to figure out the advances based on the same font and fallback pattern as the real final layout, just without "rounding" it into cells yet.
- `CustomTextLayout` has been updated to move the advance-correction into a separate phase from glyph shaping. Previously, we corrected the advances to nice round cell counts during shaping, which is fine for drawing, but hard for column count analysis.
- Now that there are separate phases, an `Analyze` method was added to the `CustomTextLayout` which just performs the text analysis steps and the glyph shaping, but no advance correction to column boundaries nor actual drawing.

I've taken the caching code that I was working on to improve chafa, and I've brought it into this. Now that we're doing a lot of fallback and heavy lifting in terms of analysis via the layout, we should cache the results until the font changes.

I've adjusted how column counting is done overall. It's always been in these phases:
1. We used a quick-lookup of ranges of characters we knew to rapidly decide `Narrow`, `Wide` or `Invalid` (a.k.a. "I dunno")
2. If it was `Invalid`, we consulted a table based off of the Unicode standard that has either `Narrow`, `Wide`, or `Ambiguous` as a result.
3. If it's still `Ambiguous`, we consult a render engine fallback (usually GDI or now DX) to see how many columns it would take.
4. If we still don't know, then it's `Wide` to be safe.
- I've added an additional flow here. The quick-lookup can now return `Ambiguous` off the bat for some glyph characters in the x2000-x3000 range that used to just be simple shapes but have been retroactively recategorized as emoji and are frequently now using full width color glyphs.
- This new state causes the lookup to go immediately to the render engine if it is available instead of consulting the Unicode standard table first because the half/fullwidth table doesn't appear to have been updated for this nuance to reclass these characters as ambiguous, but we'd like to keep that table as a "generated from the spec" sort of table and keep our exceptions in the "quick lookup" function.

I have confirmed the following things "just work" now:
- The windows logo flag from the demo. (💖🌌😊)
- The dotted chart on the side of crossterm demo (•)
- The powerline characters that make arrows with the Consolas patched font (██)
- An accented é
- The warning and checkmark symbols appearing same size as the X. (✔⚠🔥)

Related work items: #21167256, #21237515, #21243859, #21274645, #21296827
2019-05-02 15:29:10 -07:00
Dustin Howett d4d59fa339 Initial release of the Windows Terminal source code
This commit introduces all of the Windows Terminal and Console Host source,
under the MIT license.
2019-05-02 15:29:04 -07:00
Dustin L. Howett (MSFT) 864f45fa11
Move ColorTool to src/ (#422) 2019-04-30 12:27:06 -07:00