Commit graph

2600 commits

Author SHA1 Message Date
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
Dustin L. Howett (MSFT) 83b139596f Re-enable ARM64 in CI (#931)
Fixes #722.
2019-05-22 10:28:50 -07:00
Carlos Zamora 6a79025027 Bugfix: padding offsets selection (#906)
Closes #660.
2019-05-22 09:34:20 -07:00
The Oddball 20359d40e4 Remove satement about 1903 being available only on Insider (#928) 2019-05-22 11:14:02 -05:00
Mikael Olenfalk 6c7dfd2ce4 Use wstring_view for constants instead of wstring (#925) 2019-05-21 15:39:26 -07:00
Mike Skowronek 080843f826 Update README.md - Build the Code section (#899)
* Update README.md

Fix readme to show correct path of build tools

* Update README.md

Add mention about recommended cli tool for building.

* Update README.md

Cover powershell in build section
2019-05-21 21:44:22 +00: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
Heiko Voigt 68d0c23246 make copying of files windows localization agnostic (#741)
* make copying of files windows localization agnostic

On a german Windows when building I get the following error:

(D = Datei, V = Verzeichnis)? Ist das Ziel ...\Terminal\x64\Debug\TerminalSettings.pdb ein Dateiname
oder ein Verzeichnisname
(D = Datei, V = Verzeichnis)? f

The trick with piping 'f' for file into stdin does not work here, since
in german file is called 'Datei'. Due to the fact that the UI is
translated a 'd' is expected.

Lets use '*' at the end of the target filename which is a hack to trick
'xcopy' into assuming it is a filename her a target is a folder, if the
target does not exist.

* start fixing commandline tools to run new windows terminal

  * opencas should do the same as openterm.
  * correct the filename in openterm

openterm is able to start the terminal again, but it does not start
properly because of a missing dependency.

* remove openterm command

There is currently no plan on fixing this, because WindowsTerminal.exe
does not support unpackaged activation. Let's remove them for now.
2019-05-21 16:25:54 +00: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
Heath Stewart 461c8b53fa Add behavior of .vsconfig to README (#907) 2019-05-21 05:00:43 +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
Michael Niksa bd0e0550bb Merged PR 3286042: Add chafa resource into the DLL built by Windows Razzle
[Git2Git] Merged PR 3285709: Add chafa resource into the DLL built by Windows Razzle #21439265

Add chafa resource into the DLL built by Windows Razzle #21439265
2019-05-21 00:01:52 +00: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 Niksa a0ebd2ed1b Create Bot.md (#884)
* Create Bot.md

#882

* Update Bot.md

* Rename Bot.md to bot.md

* Update doc/bot.md

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

* Update bot.md

* Update bot.md
2019-05-20 14:27:36 +00:00
Donghyeok Tak 67f68ebf62 doc: Fix non-grammatical sentence (#895)
Replace `your` with `you` as the word `your` doesn't fit this context.
2019-05-18 13:37:00 -07:00
Neil McAlister 41a6d8ed3a Add GUIConsole sample (#285)
* Add GUIConsole sample

* Remove acrylic native functions, add a title bar

* Fix WPF app namespaces

* Respond to PR feedback

* Removed unused native calls, and fix up some stray spaces

* Switch pwsh to powershell

* Missed a spot.

* Fix typo, add newlines
2019-05-18 18:17:36 +00: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
Christian Aashamar 251505b96b doc: Changed "docs" to "doc" (#862) 2019-05-16 17:32:28 -07:00
Dustin Howett 723ff47789 inbox: Reflect Windows inbox changes from 20190516 2019-05-16 16:21:33 -07:00
Dustin L. Howett (MSFT) 7291121112
doc: add some new issue templates (#838)
Co-Authored-By: Michael Niksa <miniksa@microsoft.com>
Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com>

Fixes #751.
2019-05-16 11:24:14 -07:00
Dustin L. Howett (MSFT) 22103ff9c6
ci: Restore Taef.TestAdapter before build (#811)
Fixes #775
2019-05-16 11:22:22 -07:00
Jamie e0f131121b Fixed typo's and improved consistency. (#704) 2019-05-15 21:02:42 -07:00
Mikhail Paulyshka bc925d8909 tools: search for MSBuild in prerelease versions of MSVS (#795) 2019-05-15 20:57:26 -07:00
Kayla Cinnamon e3764b2081
Added documentation policy to README.md (#834)
* Added documentation policy to README.md

* Update README.md

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
2019-05-15 14:09:58 -07:00
Mario Kneidinger a12521ffd3 Changed "Windows Internal Library" to "Windows Implementation Library" (#827) 2019-05-15 12:28:22 -07:00
Bharat Raghunathan f867a2d4a4 Added a pull request template (#762)
* Close microsoft#752 by adding a pull request template

* Apply suggestions from code review by @miniksa and @bitcrazed

Co-Authored-By: Michael Niksa <miniksa@microsoft.com>
Co-Authored-By: Rich Turner <rich@bitcrazed.com>

* Fixed checkboxes

* Make placeholder uniform

[skip ci]
2019-05-15 12:27:31 -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
Jef LeCompte de24334898 Make's README list consistent (#790)
Made bullets consistent with other bullets.

[skip ci]
2019-05-14 16:19:54 -07: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
Michael Niksa fb72dca939 Add link to related console-docs GH repository (#784)
The console-docs repository is very related to this one. I feel it should be linked somewhere prominently in this one.
[skip ci]
2019-05-14 15:04:01 -07:00
Gil Mishal ea5270e563 added quotes to commands (#785)
thanks!
2019-05-14 14:27:39 -07:00