Commit graph

851 commits

Author SHA1 Message Date
Michael Niksa 398756bc84 doc: Add debugging notes on DebugBreak (#4163)
Provide notes on how to use Postmortem debugging to get into a specific context in both WinDBG and Visual Studio
2020-01-09 17:56:05 -08:00
Dustin Howett b3bb6c5ba7 master: bump version to v0.9 2020-01-09 17:44:36 -08:00
Kayla Cinnamon cbdfd0e2a2
Add tab width modes: equal and titleLength (#3876)
* tab sizing functionality

* Update doc/cascadia/SettingsSchema.md

Co-Authored-By: Carlos Zamora <carlos.zamora@microsoft.com>

* updated variable names to match spec

* added to defaults.json

* fixed merge conflict

Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
2020-01-09 16:16:54 -08:00
Dustin L. Howett (MSFT) 8a21698c35 Don't generate WSL distributions for docker-desktop* (#4156)
These utility distributions are used by Docker for Windows' WSL2
integration. They are not intended for user consumption.

* [x] Closes #3556
* [x] CLA signed.
* [x] Tests added/passed
* [x] Requires documentation to be updated
* [x] I've discussed this with core contributors already.

There is a minimal chance that a user _has_ a distribution named `docker-desktop` or some superstring thereof, but this is taken as an acceptable level of risk.
2020-01-09 20:26:04 +00:00
Dustin L. Howett (MSFT) 988f0a6e77 Add WT_SESSION to WSLENV so it propagates into WSL (#4157)
This makes sure that things running inside WSL can see `WT_SESSION`.

Closes #3948.
2020-01-09 19:23:48 +00:00
Dustin L. Howett (MSFT) d97135bbc9
wsl: actually close the pipe handle for wsl.exe, but only once (#4158)
We were eating an exception on exit in debug mode because we were using
wil to clean up half of a named pipe we'd already handed ownership of
over to the CRT. The CRT likes to tie up all its loose ends when it gets
unloaded, so it was coming along at exit and closing the handle again.
Big no-no.
2020-01-09 11:09:42 -08:00
Mike Griese 7edb8efac4 Add a setting to disable pane snapping (#4154)
## Summary of the Pull Request

Adds a setting `snapToGridOnResize` to disable snapping the window on resize, and defaults it to `false`.

## References
Introduced by pr #3181

## PR Checklist
* [x] Closes #3995
* [x] I work here
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
2020-01-09 17:19:21 +00:00
Michael Niksa 735d2e5613
Introduce til::some (#4123)
## Summary of the Pull Request
Introduces a type that is basically an array (stack allocated, fixed size) that reports size based on how many elements are actually filled (from the front), iterates only the filled ones, and has some basic vector push/pop semantics.

## PR Checklist
* [x] I work here
* [x] I work here
* [x] I work here
* [ ] I'd love to roll this out to SomeViewports.... maybe in this commit or a follow on one.
* [ ] We need a TIL tests library and I should test this there. 

## Detailed Description of the Pull Request / Additional comments
The original gist of this was used for `SomeViewports` which was a struct to hold between 0 and 4 viewports, based on how many were left after subtraction (since rectangle subtraction functions in Windows code simply fail for resultants that yield >=2 rectangle regions.)

I figured now that we're TIL-ifying useful common utility things that this would be best suited to a template because I'm certain there are other circumstances where we would like to iterate a partially filled array and want it to not auto-resize-up like a vector would.

## Validation Steps Performed
* [ ] TIL tests added
2020-01-09 09:07:52 -08:00
mcpiroman d4c527607a Snap to character grid when resizing window (#3181)
When user resizes window, snap the size to align with the character grid
(like e.g. putty, mintty and most unix terminals). Properly resolves
arbitrary pane configuration (even with different font sizes and
padding) trying to align each pane as close as possible.

It also fixes terminal minimum size enforcement which was not quite well
handled, especially with multiple panes.

This PR does not however try to keep the terminals aligned at other user
actions (e.g. font change or pane split). That is to be tracked by some
other activity.

Snapping is resolved in the pane tree, recursively, so it (hopefully)
works for any possible layout.

Along the way I had to clean up some things as so to make the resulting
code not so cumbersome:
1. Pane.cpp: Replaced _firstPercent and _secondPercent with single
   _desiredSplitPosition to reduce invariants - these had to be kept in
   sync so their sum always gives 1 (and were not really a percent). The
   desired part refers to fact that since panes are aligned, there is
   usually some deviation from that ratio.
2. Pane.cpp: Fixed _GetMinSize() - it was improperly accounting for
   split direction
3. TerminalControl: Made dedicated member for padding instead of
   reading it from a control itself. This is because the winrt property
   functions turned out to be slow and this algorithm needs to access it
   many times. I also cached scrollbar width for the same reason.
4. AppHost: Moved window to client size resolution to virtual method,
   where IslandWindow and NonClientIslandWindow have their own
   implementations (as opposite to pointer casting).

One problem with current implementation is I had to make a long call
chain from the window that requests snapping to the (root) pane that
implements it: IslandWindow -> AppHost's callback -> App ->
TerminalPage -> Tab -> Pane. I don't know if this can be done better.

## Validation Steps Performed
Spam split pane buttons, randomly change font sizes with ctrl+mouse
wheel and drag the window back and forth.

Closes #2834
Closes #2277
2020-01-08 13:19:23 -08:00
Michael Niksa 913c5ec744 Correct passthrough sequences after refactor (#4125)
## Summary of the Pull Request
When refactoring the `StateMachine::ProcessString` algorithm to use safer structures, I made an off-by-one error when attempting to simplify the loop. 

## References
- Introduced in #3956 

## PR Checklist
* [x] Closes #4116
* [x] I work here.
* [x] Tests added/passed
* [x] No documentation
* [x] I'm a core contributor.

## Detailed Description of the Pull Request / Additional comments
The algorithm in use exploited holding onto some pointers and sizes as it rotated around the loop to call back as member variables in the pass-through function `FlushToTerminal`. 

As a part of the refactor, I adjusted to persisting a `std::wstring_view` of the currently processing string instead of pointer/size. I also attempted to simplify the loop at the same time as both the individual and group branches were performing some redundant operations in respect to updating the "run" length. 

Turns out, I made a mistake here. I wrote it so it worked correctly for the bottom half where we transition from bulk printing to an escape but then I messed up the top case.

## Validation Steps Performed
- [x] Manual validation of the exact command given in the bug report.
- [x] Wrote automated tests to validate both paths through the `ProcessString` loop that work with the `_run` variable.
2020-01-08 19:16:49 +00:00
Leonard Hecker 83f8973000 Fix IME/CoreTextEditContext not being reset properly (#4140)
The first argument to `NotifyTextChanged` incorrectly was `[0,0]`
instead of the length of the text to be removed from the
`CoreTextEditContext`.

Best source of documentation for `NotifyTextChanged`:
https://docs.microsoft.com/en-us/windows/uwp/design/input/custom-text-input#overriding-text-updates

FYI @DHowett-MSFT (just in case): C++/WinRT uses `winrt::param::hstring`
for string parameters which intelligently borrows strings. As such you
can simply pass a `std::wstring` to most WinRT methods without the need
of having to allocate an intermediate `hstring`. 🙂

## Validation Steps Performed

I followed the reproduction instructions of #3706 and #3745 and ensured
the issue doesn't happen anymore.

Closes #3645
Closes #3706
Closes #3745
2020-01-08 17:45:25 +00:00
Mike Griese 911a9dda4d Fix a test that regressed during #3575 (#4143) 2020-01-07 15:18:04 -08:00
Chester Liu 718d334ba5 Correct improper usage of THROW_IF_NULL_ALLOC (#4128)
Closes #4099
2020-01-07 13:27:18 -08:00
Kaiyu Wang 5119ed1645 add a spec for initial position and launch mode (#2654) 2020-01-07 10:50:48 -08:00
Dustin L. Howett (MSFT) 4882917499
Fix flipped sense in TerminalDispatch::CursorPosition (#4113)
Fixes #4107.
2020-01-06 14:45:20 -08:00
Hannes Nel a60ed52064 Terminal uses system default for number of rows scrolled at a t… (#3575)
The terminal will use the system setting to determine the number of lines to scroll at a time.
This can be overridden by adding rowsToScroll to app global settings file.
terminal will use the system setting if the app setting is 0, or not specified. No restart is needed to reflect setting changes in system or the settings file.

The default was hardcoded to 4 in the code with a todo comment. 1 works better on precision touchpads, where 4 scrolls too fast.

Co-authored-by: Hannes Nel <hannesne@microsoft.com>
2020-01-06 09:39:02 -08:00
Michael Niksa d711d731d7
Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016)
## Summary of the Pull Request
- Enables auditing of some Terminal libraries (Connection, Core, Settings)
- Also audit WinConPTY.LIB since Connection depends on it

## PR Checklist
* [x] Rolls audit out to more things
* [x] I work here
* [x] Tests should still pass
* [x] Am core contributor

## Detailed Description of the Pull Request / Additional comments
This is turning on the auditing of these projects (as enabled by the heavier lifting in the other refactor) and then cleaning up the remaining warnings.

## Validation Steps Performed
- [x] Built it
- [x] Ran the tests
2020-01-03 10:44:27 -08:00
Michael Niksa 322989d017 Apply audit mode to TerminalInput/Adapter/Parser libraries (#4005)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
- Enables auditing of Virtual Terminal libraries (input, adapter, parser)

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Rolls audit out to more things
* [x] I work here
* [x] Tests should still pass
* [x] Am core contributor
* [x] Closes #3957

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
This is turning on the auditing of these projects (as enabled by the heavier lifting in the other refactor) and then cleaning up the remaining warnings.

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
- [x] Built it
- [x] Ran the tests
2020-01-03 14:25:21 +00:00
Mike Griese f467422912 Fix a crash when dragging a debug conhost across a DPI boundary (#4022)
## Summary of the Pull Request

When dragging _DEBUG_ conhost across a DPI boundary, we'd crash. This doesn't repro for some reason on Release builds. Maybe @miniksa can share some light why that is.

## PR Checklist
* [x] Closes #4012
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed
Dragged it across the boundary again, doesn't crash anymore 🙏
2020-01-02 17:52:17 +00:00
Chester Liu 052e510694 Replace bitwise flipping with WI_ flag helpers (#4083)
## PR Checklist
* [X] Closes #4026

I didn't found much to do in `InputStateMachineEngine.cpp`, though.
2020-01-01 02:51:08 +00:00
Mike Griese f6774a730f Fix a crash when calling SetConsoleScreenBufferSize in conpty (#4021) 2019-12-31 10:29:27 -08:00
Mike Griese 8b2189f6f0 Add a note regarding unbinding keys (#4084) 2019-12-30 10:08:30 -08:00
Mike Griese b5adc87164 doc: Add notes re:Application must be run from VS (#4085) 2019-12-30 09:41:08 -08:00
David Teresi e2a66c4f1c Immediately show the cursor on terminal focus (#4032)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request

Before, when a terminal window was focused, the blinking cursor would initially be hidden. This PR will immediately show the cursor when the window is focused, making it easier to keep track of the cursor.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References

#3761

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #3761
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

I guess I'm the cursor guy now

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed

* Switched rapidly between different panes, different tabs and focused and unfocused the main window repeatedly.
2019-12-30 14:28:54 +00:00
Andrii Dieiev 6bee2a6df5 Fix matches of multiple schemas on "profiles" (#4045)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Adds proper `type` for `ProfilesObject` definition to avoid warnings about matches of multiple schemas.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References
Original issue: #3909
Related PR: #3892
Relates VSCode issue: https://github.com/microsoft/vscode/issues/86738

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #3909
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] No new tests ~Tests added/passed~
* [ ] No docs update needed ~Requires documentation to be updated~
* [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #3909 (marked as help wanted)

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
1. Download `doc/cascadia/profiles.schema.json` locally
1. Open `profiles.json` from WT in VSCode
1. Replace `$schema` value with path to local copy (verified that all errors are still in place and validations works as before)
1. Update it with `type` on `ProfilesObject`
1. Check that `Matches multiple schemas when only one must validate` warning is fixed
2019-12-30 08:15:50 -06:00
James Holderness 4daf1d7f9c Remove the VT52 movement ops for now, to avoid conflicting with the VT100 IND control. (#4044)
## Summary of the Pull Request

This removes support for the the VT52 cursor movement operations, in preparation for PR #3271, since the cursor back operation conflicts with the VT100 [`IND`](https://vt100.net/docs/vt510-rm/IND.html) sequence, which we're planning to add. Eventually these ops will be brought back as part of a proper VT52 implementation, when appropriately activated by the [`DECANM`](https://vt100.net/docs/vt510-rm/DECANM.html) mode.

## References

#976 #3271

## PR Checklist
* [ ] Closes #xxx
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #3271

## Detailed Description of the Pull Request / Additional comments

The operations were removed from the `OutputStateMachineEngine`, and their associated test cases were removed from `StateMachineExternalTest`. There is no real loss of functionality here, since these sequences were never valid as implemented.

## Validation Steps Performed

I've just tested manually to confirm that the sequences no longer work.
2019-12-24 23:37:52 +00:00
Kaiyu Wang a322ff06f8
Fix Search non-blocking follow-ups (#4028)
* search box text localization and search parameters refactoring

* format fix

* remvove unecessary spaces

* Tooltips text localization, CR chanegs

* Move ESC handling to SearchBoxControl

* format check

* mark Esc key input as handled in SearchBoxControl
2019-12-20 17:35:31 -08:00
Michael Niksa 6f667f48ae
Make the terminal parser/adapter and related classes use modern… (#3956)
## Summary of the Pull Request
Refactors parsing/adapting libraries and consumers to use safer and/or more consistent mechanisms for passing information.

## PR Checklist
* [x] I work here
* [x] Tests still pass
* [x] Am a core contributor.

## Detailed Description of the Pull Request / Additional comments
This is in support of hopefully turning audit mode on to more projects. If I turned it on, it would immediately complain about certain classes of issues like pointer and size, pointer math, etc. The changes in this refactoring will eliminate those off the top.

Additionally, this has caught a bunch of comments all over the VT classes that weren't updated to match the parameters lists.

Additionally, this has caught a handful of member variables on classes that were completely unused (and now gone).

Additionally, I'm killing almost all hungarian and shortening variable names. I'm only really leaving 'p' for pointers.

Additionally, this is vaguely in support of a future where we can have "infinite scrollback" in that I'm moving things to size_t across the board. I know it's a bit of a memory cost, but all the casting and moving between types is error prone and unfun to save a couple bytes.

## Validation Steps Performed
- [x] build it
- [x] run all the tests
- [x] everyone looked real hard at it
2019-12-19 14:12:53 -08:00
Mike Griese 2e26c3e0c9 Add support for "Automatic" splits (#4025)
## Summary of the Pull Request

Adds support for `auto` as a potential value for a `splitPane` keybinding's `split` argument. For example:

```json
        { "keys": [ "ctrl+shift+z" ], "command": { "action": "splitPane", "profile": "matrix", "commandline": "cmd.exe", "split":"auto" } },
```

When set to `auto`, Panes will decide which direction to split based on the available space within the terminal. If the pane is wider than it is tall, the pane will introduce a new vertical split (and vice-versa).

## References

## PR Checklist
* [x] Closes #3960
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed
Ran tests, played with it.
2019-12-19 21:47:19 +00:00
Mike Griese ae580e7b07 update to the latest MUX prerelease (#4024)
## Summary of the Pull Request

This latest MUX prerelease fixes the issue where the tab row wouldn't expand to fill the width of the window after shrinking the window size.

## PR Checklist
* [x] Closes #3300
* [x] I work here
* [n/a] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

Thanks again @teaP for help fixing this

## Validation Steps Performed

Launched the terminal, played with it a bit
2019-12-19 18:16:07 +00:00
Michael Niksa 46043c8ee8 Add internal branding corner to Universal terminal... (#4017)
... to convey that it's not ready for production.
2019-12-18 16:51:06 -08:00
Dustin L. Howett (MSFT) e294e6634b
Add Int, Dev and IntDev assets; switch to them (#4006) 2019-12-17 19:57:51 -08:00
Dustin L. Howett (MSFT) 9634c9e551
Fix the WPR profile (#4007) 2019-12-17 17:14:15 -08:00
Douglas Thrift 5bfa408da7 Fix columns in SettingsSchema.md Profiles section (#4004)
- The `Description` for `selectionBackground` in the Profiles section was in the `Default` column, add an empty default column to fix this.
2019-12-17 16:45:23 -06:00
Mike Griese 5852ea3aca Hey look the TermControl needs to depend on the UIA renderer (#3983)
We unintentionally broke the build in #2930. If you're building the entire solution,
then you won't have any problems, because the `UiaRenderer` project will get built
before the `TerminalControl`. However, if you're like me and you only really build the
solution one project at a time, you'll find that building `TerminalControl` won't
build `UiaRenderer` automagically.

This fixes that.

s/o to @Rrogntudju for catching this
2019-12-17 10:16:26 -08:00
IBRAHIM SAMAD 6cff0435ae doc: fix a typo in the default settings discussion (#3980)
This change fixed a typo with the grammatical construct in the sentence.
2019-12-17 10:13:28 -08:00
James Holderness c0b8b85a47 Add support for the DECALN escape sequence (#3968)
## Summary of the Pull Request

This adds support for the [`DECALN`](https://vt100.net/docs/vt510-rm/DECALN.html) escape sequence, which produces a kind of test pattern, originally used on VT terminals to adjust the screen alignment. It's needed to pass several of the tests in the [Vttest](https://invisible-island.net/vttest/) suite.

## PR Checklist
* [x] Closes #3671
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [x] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Detailed Description of the Pull Request / Additional comments

To start with, the `ActionEscDispatch` method in the `OutputStateMachineEngine` needed to be extended to check for a new intermediate type (`#`). Then when that intermediate is followed by an `8`, it dispatches to a new `ScreenAlignmentPattern` method in the `ITermDispatch` interface.

The implementation of the `ScreenAlignmentPattern` itself is fairly simple. It uses the recently added `PrivateFillRegion` API to fill the screen with the character `E` using default attributes. Then in addition to that, a bunch of VT properties are reset:

* The meta/extended attributes are reset (although the active colors must be left unchanged).
* The origin mode is set to absolute positioning.
* The scrolling margins are cleared.
* The cursor position is moved to home.

## Validation Steps Performed

I've added a screen buffer test that makes sure the `DECALN` sequence fills the screen with the correct character and attributes, and that the above mentioned properties are all updated appropriately.

I've also tested in Vttest, and confirmed that the first two pages of the _Test of cursor movements_ are now showing the frame of E's that are expected there.
2019-12-17 18:11:52 +00:00
Kaiyu Wang d7ae8e6db9 Search - add search box control and implement search experience (#3590)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
This is the PR for feature Search: #605 
This PR includes the newly introduced SearchBoxControl in TermControl dir, which is the search bar for the search experience. And the codes that enable Search in Windows Terminal. 

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
The PR that migrates the Conhost search module: https://github.com/microsoft/terminal/pull/3279
Spec (still actively updating): https://github.com/microsoft/terminal/pull/3299
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #605 
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
These functionalities are included in the search experience. 
1. Search in Terminal text buffer. 
2. Automatic wrap-around. 
3. Search up or down switch by clicking different buttons.
4. Search case sensitively/insensitively by clicking a button.                                                                                                                                                S. Move the search box to the top/bottom by clicking a button. 
6. Close by clicking 'X'. 
7. Open search by ctrl + F.

When the searchbox is open, the user could still interact with the terminal by clicking the terminal input area. 

While I already have the search functionalities, currently there are still some known to-do works and I will keep updating my PR:

1. Optimize the search box UI, this includes:
                                                  1) Theme adaptation. The search box background and font color 
                                                       should change according to the theme, 
                                                  2) Add background. Currently the elements in search box are all
                                                      transparent. However, we need a background. 
                                                  3) Move button should be highlighted once clicked. 
2. Accessibility: search process should be able to performed without mouse. Once the search box is focused, the user should be able to navigate between all interactive elements on the searchbox using keyboard. 

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->

To test:
1. checkout this branch.
2. Build the project. 
3. Start Windows Terminal and press Ctrl+F
4. The search box should appear on the top right corner.
2019-12-17 15:52:37 +00:00
Daniel599 dccb29790e Fix move focus between grouped panes (#3045) (#3958)
This PR fixes the ability to move between already-split panes
## Summary of the Pull Request

## PR Checklist
* [x] Closes #3045
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed
Tested manually.
2019-12-16 23:17:06 +00:00
greg904 abb2df13b8 Use WS_POPUP for NonClientIslandWindow instead of overriding WM_NCCALCSIZE to remove borders (#3721)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request

Fixes the sides disappearing when entering full screen mode when the window is maximized.
However, now, a Vista-style frame briefly appears when entering/exiting full screen.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #3709
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [x] Requires documentation to be updated (no)
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

When the non-client island window is maximized and has the WS_OVERLAPPEDWINDOW style, SetWindowPos is "lying": the position ends up being offset compared to the one we gave it (found by debugging). So I changed it to use WS_POPUP like the client island window was already doing. But now it has the Vista frame that appears briefly when entering/exiting full screen like the client island window.

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2019-12-16 20:58:38 +00:00
Kaiyu Wang d95020ee9d Add a spec for search, #605 (#3299) 2019-12-13 16:41:42 -08:00
Michael Kitzan 19babc0ec5 Fix SetColorTableEntry off-by-one error (#3938)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Uses the verification in `at` to ensure the index is correct (as @j4james suggests). If `at` throws, then returns false.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #3720
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [x] ~~I've~~ discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #3720

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Can no longer repro the issue after the fix.
2019-12-14 00:41:04 +00:00
Michael Kitzan a3f3cc823c Fixed self capture in TermControl (#3908)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
An asynchronous event handler capturing raw `this` in `TermControl` was causing an exception to be thrown when a scroll update event occurred after closing the active tab. This PR replaces all non-auto_revoke lambda captures in `TermControl` to capture (and validate) a `winrt::weak_ref` instead of using raw `this`.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #2947
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #2947

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
`TermControl` is already a WinRT type so no changes were required to enable the `winrt::weak_ref` functionality. There was only one strange change I had to make. In the destructor's helper function `Close`, I had to remove two calls to [`Stop`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.dispatchertimer.stop#Windows_UI_Xaml_DispatcherTimer_Stop) which were throwing under [some circumstances](https://github.com/microsoft/terminal/issues/2947#issuecomment-562914135). Fortunately, these calls don't appear to be critical, but definitely a spot to look into when reviewing this PR.

Beyond scrolling, any anomalous crash related to the following functionality while closing a tab or WT may be fixed by this PR:
- Settings updating
- Changing background color

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Before these changes I was able to consistently repro the issue in #2947. Now, I can no longer repro the issue.
2019-12-13 13:28:35 +00:00
Michael Kitzan 29619d35d7 Fix ResizePseudoConsole accepting negative values (#3936)
Closes #3447.
2019-12-12 17:48:06 -08:00
Carlos Zamora 4b48f74f5f
Enable Word Navigation in UiaTextRange (#3659)
Enables support for word navigation when using an automation client (i.e.: Narrator, etc...). Specifically, adds this functionality to the UiaTextRange class. The only delimiter used is whitespace because that's how words are separated in English.

# General "Word Movement" Expectations
The resulting text range should include any word break characters that are present at the end of the word, but before the start of the next word. (Source)

If you already are on a word, getting the "next word" means you skip the word you are on, and highlight the upcoming word appropriately. (similar idea when moving backwards)


# Word Expansion
Since word selection is supposed to detect word delimiters already, I figured I'd reuse that code. I moved it from TerminalCore to the TextBuffer.

Then I built on top of it by adding an optional additional parameter that decides if you want to include...
- the delimiter run when moving forward
- the character run when moving backwards
It defaults to false so that we don't have to care when using it in selection. But we change it to true when using it in our UiaTextRange

# UiaTextRange
The code is based on character movement. This allows us to actually work with boundary conditions.

The main thing to remember here is that each text range is recorded as a MoveState. The text range is most easily defined when you think about the start Endpoint and the end Endpoint. An Endpoint is just a linear 1-dimensional indexing of the text buffer. Examples:
- Endpoint 0 --> (0,0)
- Endpoint 79 --> (79,0) (when the buffer width is 80)
- Endpoint 80 -->(0,1) (when the buffer width is 80)
- When moving forward, the strategy is to focus on moving the end Endpoint. That way, we properly get the indexing for the "next" word (this also fixes a wrapping issue). Then, we update the start Endpoint. (This is reversed for moving backwards).
- When moving a specific Endpoint, we just have a few extra if statements to properly adjust for moving start vs end.

# Hooking it up
All we really had to do is add an enum. This part was super easy :)

I originally wanted the delimiters to be able to be defined. I'm not so sure about that anymore. Either way, I hardcoded our delimiter into a variable so if we ever want to expand on it or make that customizable, we just modify that variable.

# Defining your own word delimiters

- Import a word delimiter into the constructor of the ScreenInfoUiaProvider (SIUP)
  - This defines a word delimiter for all the UiaTextRanges (UTR) created by in this context
- import a word delimiter into the UTR directly
  - this provides more control over what a "word" is
  - this can be useful if you have an idea of what text a particular UTR will encounter and you want to customize the word navigation for it (i.e consider adding / or \\ for file paths)

The default param of " " is scattered throughout because this is the word delimiter used in the English language.
2019-12-12 15:22:12 -08:00
Dustin L. Howett (MSFT) 8d9f657d43 Update the version in master to 0.8 (#3933)
Since we're producing servicing releases from the release-0.7 branch,
this will let us produce preview releases that are on a separate version train.
2019-12-12 19:53:47 +00:00
Mike Griese 9d42599939 Add some issue numbers for TODOs from #3468 (#3931)
## Summary of the Pull Request

The original PR had a few TODOs in it without issue numbers. IMO, this wasn't important enough to block the PR over. _Also I'm impatient and wanted that setting_. 

After I merged the PR I created the issues and added the numbers myself.

## References

## PR Checklist
* [x] Closes nothing, this just adds a couple TODOs
* [x] I work here
* [x] this _really_ doesn't need tests
* [x] This _is_ a docs update
2019-12-12 18:55:26 +00:00
Mike Griese ffcedf2e75
add src/cascadia/ to ORGANIZATION.md (#3932)
## Summary of the Pull Request

Pretty much the title here.

## References

## PR Checklist
* [x] Closes #3780
* [x] I work here
* [x] documentation updated
2019-12-12 12:27:05 -06:00
ironyman 9ae43377b0 Add experimental retro terminal effects (#3468)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Cool retro terminal effects
- glow
- scan lines
- cool
- will make terminal competitive with iterm2

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [ ] Closes #xxx
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
![image](https://user-images.githubusercontent.com/502496/68365644-20bda900-00e6-11ea-8a9d-0a4482e48c5a.png)
2019-12-12 13:44:01 +00:00
Michael Niksa 9cae3c439e Enable Audit Mode for WinRTUtils (#3923)
## Summary of the Pull Request
Turns on Audit for WinRTUtils, fixes audit failures.

## PR Checklist
* [x] I work here
* [x] Still builds
* [x] Am core contributor.

## Validation Steps Performed
Built it.
2019-12-12 13:28:32 +00:00