Commit graph

1281 commits

Author SHA1 Message Date
Michael Niksa 70867df077
Scale box drawing glyphs to fit cells for visual bliss (#5743)
## Summary of the Pull Request
Identifies and scales glyphs in the box and line drawing ranges U+2500-U+259F to fit their cells.

## PR Checklist
* [x] Closes #455
* [x] I work here.
* [x] Manual tests. This is all graphical.
* [x] Metric ton of comments
* [x] Math spreadsheet included in PR.
* [x] Double check RTL glyphs.
* [x] Why is there the extra pixel?
* [x] Scrolling the mouse wheel check is done.
* [x] Not drawing outline?
* [x] Am core contributor. Roar.
* [x] Try suppressing negative scale factors and see if that gets rid of weird shading.

## Detailed Description of the Pull Request / Additional comments

### Background
- We want the Terminal to be fast at drawing. To be fast at drawing, we perform differential drawing, or only drawing what is different from the previous frame. We use DXGI's `Present1` method to help us with this as it helps us compose only the deltas onto the previous frame at drawing time and assists us in scrolling regions from the previous frame without intervention. However, it only works on strictly integer pixel row heights.
- Most of the hit testing and size-calculation logic in both the `conhost` and the Terminal products are based on the size of an individual cell. Historically, a cell was always dictated in a `COORD` structure, or two `SHORT` values... which are integers. As such, when we specify the space for any individual glyph to be displayed inside our terminal drawing region, we want it to fall perfectly inside of an integer box to ensure all these other algorithms work correctly and continue to do so.
- Finally, we want the Terminal to have font fallback and locate glyphs that aren't in the primary selected font from any other font it can find on the system that contains the glyph, per DirectWrite's font fallback mechanisms. These glyphs won't necessarily have the same font or glyph metrics as the base font, but we need them to fit inside the same cell dimensions as if they did because the hit testing and other algorithms aren't aware of which particular font is sourcing each glyph, just the dimensions of the bounding box per cell.

### How does Terminal deal with this?
- When we select a font, we perform some calculations using the design metrics of the font and glyphs to determine how we could fit them inside a cell with integer dimensions. Our process here is that we take the requested font size (which is generally a proxy for height), find the matching glyph width for that height then round it to an integer. We back convert from that now integer width to a height value which is almost certainly now a floating point number. But because we need an integer box value, we add line padding above and below the glyphs to ensure that the height is an integer as well as the width. Finally, we don't add the padding strictly equally. We attempt to align the English baseline of the glyph box directly onto an integer pixel multiple so most characters sit crisply on a line when displayed. 
- Note that fonts and their glyphs have a prescribed baseline, line gap, and advance values. We use those as guidelines to get us started, but then to meet our requirements, we pad out from those. This results in fonts that should be properly authored showing gaps. It also results in fonts that are improperly authored looking even worse than they normally would.

### Now how does block and line drawing come in?
- Block and Line drawing glyphs are generally authored so they will look fine when the font and glyph metrics are followed exactly as prescribed by the font. (For some fonts, this still isn't true and we want them to look fine anyway.)
- When we add additional padding or rounding to make glyphs fit inside of a cell, we can be adding more space than was prescribed around these glyphs. This can cause a gap to be visible.
- Additionally, when we move things like baselines to land on a perfect integer pixel, we may be drawing a glyph lower in the bounding box than was prescribed originally.

### And how do we solve it?
- We identify all glyphs in the line and block drawing ranges.
- We find the bounding boxes of both the cell and the glyph.
- We compare the height of the glyph to the height of the cell to see if we need to scale. We prescribe a scale transform if the glyph wouldn't be tall enough to fit the box. (We leave it alone otherwise as some glyphs intentionally overscan the box and scaling them can cause banding effects.)
- We inspect the overhang/underhang above and below the boxes and translate transform them (slide them) so they cover the entire cell area.
- We repeat the previous two steps but in the horizontal direction.

## Validation Steps Performed
- See these commments:
   - https://github.com/microsoft/terminal/issues/455#issuecomment-620248375
   - https://github.com/microsoft/terminal/issues/455#issuecomment-621533916
   - https://github.com/microsoft/terminal/issues/455#issuecomment-622585453

Also see the below one with more screenshots:
   - https://github.com/microsoft/terminal/pull/5743#issuecomment-624940567
2020-05-08 14:09:32 -07:00
Mike Griese d77745d035
Manually select a new tab when we're in fullscreen mode (#5809)
If we're fullscreen, the TabView isn't `Visible`. If it's not `Visible`,
it's _not_ going to raise a `SelectionChanged` event, which is what we
usually use to focus another tab. Instead, we'll have to do it manually
here.

So, what we're going to try to do is move the focus to the tab to the
left, within the bounds of how many tabs we have.

EX: we have 4 tabs: [A, B, C, D]. If we close:
* A (`tabIndex=0`): We'll want to focus tab B (now in index 0)
* B (`tabIndex=1`): We'll want to focus tab A (now in index 0)
* C (`tabIndex=2`): We'll want to focus tab B (now in index 1)
* D (`tabIndex=3`): We'll want to focus tab C (now in index 2)

`_UpdatedSelectedTab` will do the work of setting up the new tab as the
focused one, and unfocusing all the others.

Also, we need to _manually_ set the SelectedItem of the tabView here. If
we don't, then the TabView will technically not have a selected item at
all, which can make things like ClosePane not work correctly.

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

## Validation Steps Performed

Played with it a bunch
2020-05-08 11:53:34 -07:00
Carlos Zamora 28dc8196ab
Add an AppDescription for the Preview package (#5794) 2020-05-07 11:34:43 -07:00
Carlos Zamora 9a927f3a0f
Add a new appxmanifest for preview (#5774)
## Summary of the Pull Request
This adds a new appxmanifest for 'Windows Terminal (Preview)' and links the resources.

Code-wise, split up `WindowsTerminalReleaseBuild` into...
- WindowsTerminalOfficialBuild: [true, false]
- WindowsTerminalBranding: [Dev, Preview, Release]

Added a comment about that in release.yml

## Validation Steps Performed
used msbuild to build...
- [X] Dev
- [X] Preview
- [X] Release
then checked the msix for the correct name/icon.
2020-05-07 16:00:56 +00:00
uSlackr 1d72e771b5
Update docs to mention commandline args (#5765) 2020-05-06 12:08:18 -07:00
Dustin Howett 25f650578e Merge remote-tracking branch 'openconsole/inbox' 2020-05-05 16:03:37 -07:00
Michael Niksa 92812bf316 Merged PR 4645239: [Git2Git] Merged PR 4644345: conhost: disable the DX renderer in inbox builds
[Git2Git] Merged PR 4644345: conhost: disable the DX renderer in inbox builds

We're going to be taking on some changes to the Dx renderer that are at
the very least annoying and at the very most inconsequential to the
inbox console. This commit removes support for the DX renderer from the
inbox console.

SizeBench reports that ConRenderDx contributes 55.1kb to the conhost
image (as its third largest constituent library), so this should net us
a couple pleasant WPG improvements down the line.

Related work items: #26291552 Retrieved from https://microsoft.visualstudio.com os OS official/rs_onecore_dep_uxp 6e36786d447b7975298ba31ccd77c5c649fbfbe6

Related work items: #26291552
2020-05-05 23:03:07 +00:00
Dustin Howett ce91c164c2 Merge remote-tracking branch 'openconsole/inbox' 2020-05-05 15:47:32 -07:00
Michael Niksa 8e67bb2d4f Merged PR 4641914: [Git2Git] Git Train: Merge of building/rs_onecore_dep_uxp/200504-1008 into official/rs_onecore_dep_uxp Retrieved from https://microsoft.visualstudio.com os OS official/rs_onecore_dep_uxp bbdf04608ba96c3f8ee06cf100428cde01f3df79
[Git2Git] Git Train: Merge of building/rs_onecore_dep_uxp/200504-1008 into official/rs_onecore_dep_uxp Retrieved from https://microsoft.visualstudio.com os OS official/rs_onecore_dep_uxp bbdf04608ba96c3f8ee06cf100428cde01f3df79

Related work items: #26071826
2020-05-05 22:47:08 +00:00
Dustin L. Howett (MSFT) 9e1d2d2e63
res: on second thought, tuck the lozenge in at smaller sizes (#5757) 2020-05-05 15:13:25 -07:00
Dustin L. Howett (MSFT) 0eaa7214ae
Switch to the new lozenge-style dev icons and add preview icons (#5755)
This commit also introduces a copy of the svg source for the icon.

The icons were generated with a powershell script, which will be the
subject of a future checkin.

Below, peep the asset size ramps. The text is hidden at sizes <32px because it would be illegible. Click for full size, as they do not necessarily fit in the GitHub box.

![montage](https://user-images.githubusercontent.com/14316954/81114789-8c3ad480-8ed7-11ea-8963-67ba195f25b8.png)

![montage](https://user-images.githubusercontent.com/14316954/81114796-8f35c500-8ed7-11ea-881f-c69fc9468914.png)
2020-05-05 21:29:09 +00:00
Mike Griese 7a251d85f7
Don't set the new tab button colors for now (#5749)
This is actually related to another issue we have, #3917. I think if the system is set to "Dark" theme, but the app is set to light theme, then the brush lookup in `_ClearNewTabButtonColor` still returns to us the dark theme brushes.

Fortunately, since we're not actually setting the color of the new tab button anymore, we can just remove the call to that method now, and loop back on it later.

## References
* regressed in #3789 
* related to #3917

## PR Checklist
* [x] Closes #5741
2020-05-05 13:33:07 -07:00
uSlackr fb08b6bf49
Add File Explorer tip to User Docs (#5752) 2020-05-05 09:50:27 -07:00
Dustin L. Howett (MSFT) 046fed3d97
Make sure we don't try to remove tabs when they don't exist (#5742)
This was an oversight.

Fixes #5738.
2020-05-05 09:16:09 -07:00
Dustin L. Howett (MSFT) 7d54bc5ecb
version: bump to 1.1 on master 2020-05-04 18:52:44 -07:00
Mike Griese 9fe624ffbc
Make sure that EraseAll moves the Terminal viewport (#5683)
The Erase All VT sequence (`^[[2J`) is supposed to erase the entire
contents of the viewport. The way it usually does this is by shifting
the entirety of the viewport contents into scrollback, and starting the
new viewport below it. 

Currently, conpty doesn't propagate that state change correctly. When
conpty gets a 2J, it simply erases the content of the connected
terminal's viewport, by writing over it with spaces. Conpty didn't
really have a good way of communicating "your viewport should move", it
only knew "the buffer is now full of spaces".

This would lead to bugs like #2832, where pressing <kbd>ctrl+L</kbd> in
`bash` would delete the current contents of the viewport, instead of
moving the viewport down.

This PR makes sure that when conpty sees a 2J, it passes that through
directly to the connected terminal application as well. Fortunately, 2J
was already implemented in the Windows Terminal, so this actually fixes
the behavior of <kbd>ctrl+L</kbd>/`clear` in WSL in the Terminal.

## References

* #4252 - right now this isn't the _most_ optimal scenario, we're
  literally just printing a 2J, then we'll perform "erase line" `height`
  times. The erase line operations are all redundant at this point - the
  entire viewport is blank, but conpty doesn't really know that.
  Fortunately, #4252 was already filed for me to come through and
  optimize this path.

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

## Validation Steps Performed
* ran tests
* compared <kbd>ctrl+L</kbd> with its behavior in conhost
* compared `clear` with its behavior in conhost
2020-05-05 01:36:30 +00:00
Mike Griese 9166a14f4b
Fix a few minor typos from #3789 (#5740)
I never got to fixing these in the original #3789 PR, but I messed up that branch way too many times already that I figured I'd just do it in post.

* [x] Fixes the typo bot in `master`
* [x] I work here
2020-05-04 16:47:29 -05:00
Georgi Baychev 624a553d23
Add support for setting a tab's color at runtime w/ context menu (#3789)
This commit introduces a context menu for Tab and a new item,
"Color...", which will display a color picker.

A flyout menu, containing a custom flyout, is attached to each tab. The
flyout displays a palette of 16 preset colors and includes a color
picker. When the user selects or clears color, an event is fired, which
is intercepted by the tab to which the flyout belongs.

The changing of the color is achieved by putting the selected color in
the resource dictionary of the tab, using well-defined dictionary keys
(e.g. TabViewItemHeaderBackground). Afterwards the visual state of the
tab is toggled, so that the color change is visible immediately.

Custom-colored tabs will be desaturated (somewhat) by alpha blending
them with the tab bar background.

The flyout menu also contains a 'Close' flyout item.

## Validation Steps Performed
I've validated the behavior manually: start the program via the start
menu. Right click on the tab -> Choose a tab color.

The color flyout is going to be shown. Click a color swatch or click
'Select a custom color' to use the color picker. Use the 'Clear the
current color' to remove the custom color.

Closes #2994. References #3327.
2020-05-04 20:57:12 +00:00
Mike Griese 6ce3357bab
Add support for displaying the version with wt --version (#5501)
## Summary of the Pull Request
Here's 3000 words:

![image](https://user-images.githubusercontent.com/18356694/80125877-e2af2700-8557-11ea-809a-63e50d76fe2b.png)
![image](https://user-images.githubusercontent.com/18356694/80125882-e5aa1780-8557-11ea-8f73-2e50c409b76d.png)
![image](https://user-images.githubusercontent.com/18356694/80125886-e8a50800-8557-11ea-8d28-6d1694c57c0c.png)

## References
* #4632 

## PR Checklist
* [x] Closes #5494
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated
2020-05-04 20:56:15 +00:00
Mike Griese 48617b7e06
Add a note that the user needs to hide dynamic profiles (#5684)
Add a note that the user needs to hide dynamic profiles, not just delete them.

* [x] I work here
* [x] Is documentation.
* related to discussion in #3231
2020-05-04 15:04:09 -05:00
Moshe Schorr 9c52920612
Fix RTL regression (fixes #4779) (#5734)
<!-- 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
This fixes the RTL regression caused in #4747. We create the rectangle taking the direction (through the BiDi Level) into account, and then the rendering works again. The GlyphRun shaping could still probably use some work to be a polished thingy, and there are still issues with RTL getting chopped up a lot when there's font fallback going on, but this fixes the regression, and it's now functional again.

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

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #4779
* [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
The baseline is actually direction dependent. So when it was being initialized, the unconditional baseline as left broke it, setting the box off to right of the text. We just check if the `GlyphRun->bidiLevel` is set, and if so, we adjust it so that the baseline lines up with the right, not with the left.

<!-- 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/16987694/80968891-681cbc00-8e21-11ea-9e5c-9b7cf6d78d53.png)
2020-05-04 16:14:44 +00:00
Anthony Vanelverdinghe 8a15b2f69b
doc: fix typo in UsingCommandlineArguments.md (#5714) 2020-05-02 23:33:10 -07:00
Kayla Cinnamon 6cbc2e5fa4
remove decreaseFontSize from schema (#5712)
It was replaced with adjustFontSize in 0.11.
2020-05-02 20:23:13 -07:00
Dustin L. Howett (MSFT) 44689b93a2
Remove the (Preview) tag from the primary App Name (#5679)
This is part of the v1 polish.
2020-05-01 16:30:16 +00:00
Eric Tian b6e46c0dc1
Add tooltip text to New Tab/Min/Max/Close (#5484)
<!-- 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
Tooltip texts is an important element of each software! Added tooltip text to close button, minimize, restore down, and new tab. Moved from original.

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

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #5355 
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [X] No Docs
* [ ] 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: #5355 

<!-- 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'm pretty sure most ppl know what a tooltip text is, but for those who don't, it's a text that tells you what a button does when you over the button with your mouse.
2020-04-30 22:45:56 +00:00
Dustin L. Howett (MSFT) d57ef135cc
On second thought, embed the third-party notices in the package (#5673)
This commit introduces a NOTICE.html file that will be embedded into the
package. It will be stamped down with the real notices during a branded
release build (as part of the build pipeline.)

It, in part, reverts some of the really good work in determining the
commit hash at build time. That work will be preserved in history.

This is more compliant with our duties to the OSS we consume.
2020-04-30 15:06:13 -07:00
Mike Griese 7612044363
Implement a pair of shims for cls, Clear-Host in conpty mode (#5627)
## Summary of the Pull Request

This PR implements a pair of shims for `cmd` and `powershell`, so that their `cls` and `Clear-Host` functions will clear the entire terminal buffer (like they do in conhost), instead of just the viewport. With the conpty viewport and buffer being the same size, there's effectively no way to know if an application is calling these API's in this way with the intention of clearing the buffer or the viewport. We absolutely have to guess. 

Each of these shims checks to see if the way that the API is being called exactly matches the way `cmd` or `powershell` would call these APIs. If it does, we manually write a `^[[3J` to the connected terminal, to get he Terminal to clear it's own scrollback.

~~_⚠️ If another application were trying to clear the **viewport** with an exactly similar API call, this would also cause the terminal scrollback to get cleared ⚠️_~~

* [x] Should these shims be restricted to when the process that's calling them is actually `cmd.exe` or `powershell.exe`? Can I even do this? I think we've done such a good job of isolating the client process information from the rest of the host code that I can't figure out how to do this.
  - YES, this can be done, and I did it.
* [ ] **TODO**: _While I'm here_, should I have `DoSrvPrivateEraseAll` (the implementation for `^[[2J`, in `getset.cpp`) also manually trigger a EraseAll in the terminal in conpty mode?

## PR Checklist
* [x] Closes #3126
* [x] Actually closes #1305 too, which is really the same thing, but probably deserves a callout
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed
* ran tests
* checked `cls` in the Terminal
* checked `Clear-Host` in the Terminal
* Checked running `powershell clear-host` from `cmd.exe`
2020-04-30 21:53:31 +00:00
Mike Griese b6a21de802
Intentionally leak our Application, so that we DON'T crash on exit (#5629)
We've got a weird crash that happens terribly inconsistently, but pretty
readily on migrie's laptop, only in Debug mode. Apparently, there's some
weird ref-counting magic that goes on during teardown, and our
Application doesn't get closed quite right, which can cause us to crash
into the debugger. This of course, only happens on exit, and happens
somewhere in the `...XamlHost.dll` code.

Crazily, if we _manually leak the `Application`_ here, then the crash
doesn't happen. This doesn't matter, because we really want the
Application to live for _the entire lifetime of the process_, so the only
time when this object would actually need to get cleaned up is _during
exit_. So we can safely leak this `Application` object, and have it just
get cleaned up normally when our process exits.

* [x] I discussed this with @DHowett-MSFT and we both agree this is mental
* [x] I'm pretty sure there's not an actual bug on our repo for this
* [x] I verified on my machine where I can crash the terminal 100% of the time on exit in debug, this fixes it
* [x] I verified that it doesn't introduce a _new_ crash in Release on my machine
2020-04-30 14:36:02 -05:00
Mike Griese 4286877864
Don't remove spaces when printing a new bottom line with a background color (#5550)
Turns out we're still being a bit too aggressive when removing spaces.
If there are spaces at the end of the first run painted to a bottom
line, _and the bottom line was a different color than the previous_,
then we can't trim those spaces off the string. We still need to emit
those to make sure the terminal has colored spaces in it as well.

## References

* there's like 80 PRs in the last month for this function

## PR Checklist
* [x] Closes #5502
* [x] I work here
* [x] Tests added/passed

## Validation Steps

* [x] ran the tests
* [x] checked that vtpipeterm still worked
* [x] Checked that the bug was fixed in the Terminal
2020-04-30 15:01:03 +00:00
Dustin L. Howett (MSFT) 3246c4250a
Bundle the entire CRT with our branded Release packages (#5661)
For our release builds, we're just going to integrate the UWPDesktop CRT
into our package and delete the package dependencies.  It's very
difficult for users who do not have access to the store to get our
dependency packages, and we want to be robust and deployable everywhere.
Since these libraries can be redistributed, it's easiest if we simply
redistribute them.

Our package grows by ~550kb per architecture (compressed) because of
this. I've added validation that we don't have both the libs _and_ the
dependencies in the same package.

Fixes #3097.

## Validation

The script does it!
2020-04-30 07:08:43 +00:00
Leon Liang 17bd8b5750
Grab the write lock before updating the font (#5654)
## Summary of the Pull Request
Based on the discussion in #5479, it seems that the crash is caused by a race condition due to not obtaining the write lock before calling `TriggerFontChange`.

I'm not totally sure if my approach is the right one, but I've taken the lock out of `_RefreshSize` since it seems like all calls of `_RefreshSize` come after a `TriggerFontChange`/`UpdateFont`. Then I just 
made sure all calls of `TriggerFontChange`/`UpdateFont` are preceded with a `LockForWriting`.

## PR Checklist
* [x] Closes #5479
* [x] CLA signed.
* [x] Tests added/passed

## Validation Steps Performed
Scrolling to change my font size does not kill the Terminal anymore! 🙌
2020-04-30 00:05:29 +00:00
pi1024e fb22eae072
Add explicit identifier to some constructors (#5652)
If a class has a constructor which can be called with a single argument,
then this constructor becomes conversion constructor because such a
constructor allows conversion of the single argument to the class being
constructed. To ensure these constructors are passed the argument of its
type, I labeled them explicit.

In some header files, there were constructors that took a value that
could involve implicit conversions, so I added explicit to ensure that
does not happen.
2020-04-29 16:50:47 -07:00
Mike Griese 10fa3108e1
Hide the commandline on a resize to prevent a crash when snapping the window (#5620)
Hide any commandline (cooked read) we have before we begin a resize, and
show it again after the resize. 

## References

* I found #5618 while I was working on this.

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

## Detailed Description of the Pull Request / Additional comments

Basically, during a resize, we try to restore the viewport position
correctly, and part of that checks where the current commandline ends.
However, when we do that, the commandline's _current_ state still
reflects the _old_ buffer size, so resizing to be smaller can cause us
to throw an exception, when we find that the commandline doesn't fit in
the new viewport cleanly.

By hiding it, then redrawing it, we avoid this problem entirely. We
don't need to perform the check on the old commandline contents (since
they'll be empty), and we'll redraw it just fine for the new buffer size

## Validation Steps Performed
* ran tests
* checked resizing, snapping in conhost with a cooked read
* checked resizing, snapping in the Terminal with a cooked read
2020-04-29 23:47:56 +00:00
Mike Griese ea02128f11
Remove the title tag from the generated HTML (#5595)
Web apps apparently will paste the <title> as plaintext before the
actual HTML content from the clipboard. Since this seems to be
widespread behavior across web apps, this isn't just a bug in _some
app_, this is a bug on us. We shouldn't emit the title. 

This PR removes the title tag from the generated HTML.

Closes #5347
2020-04-29 16:41:56 -07:00
Dustin L. Howett (MSFT) e3a99f6879
Remove "Getting Started" from the about dialog (#5656)
This is some fit/finish polish for v1.
2020-04-29 16:37:00 -07:00
Chester Liu e8a68114e8
Reserve textClusterColumns vector for performance (#5645)
<!-- 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

In tonight's episode of "Can we be even faster?", we will... you know what, just take a look at the code.

<!-- 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
* [ ] 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

It is actually a quite common technique seen inside the codebase to first reserve the spaces before pushing something into vectors. I don't know why it is not used here.

Before:
![before](https://user-images.githubusercontent.com/4710575/80594408-84051400-8a55-11ea-9c04-c0a808061976.png)

After:

![after](https://user-images.githubusercontent.com/4710575/80594402-80718d00-8a55-11ea-8639-6c038b4bfcf8.png)

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2020-04-29 20:12:05 +00:00
Chester Liu da7610117a
Added even more quick exit in InsertAttrRuns (#5644)
<!-- 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

In tonight's episode of "I wanna my CPU back", we'll see a quite familiar face whose name is Mr.AttrRow.

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

#2937

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [ ] Closes #xxx
* [ ] 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 knew this is possible a long time ago. Just didn't got the chance to actually implement this. I understand that you guys are busy preparing the v1.0 release. So if this is a bad time, this can wait.

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

Manually tested. If all goes well, nothing will be broken.
2020-04-29 20:08:37 +00:00
Mike Griese 1ce86f8f1a
Clamp the new rows scrolling value to a positive number (#5630)
## Summary of the Pull Request

This PR clamp the "new rows" scrolling value to a positive number. We can't create a negative number of new rows. It also adds a test.

## References

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

## Detailed Description of the Pull Request / Additional comments

The origin of this bug is that as newlines are emitted, we'll accumulate an enormous scroll delta into a selection region, to the point of overflowing a `SHORT`. When the overflow occurs, the `Terminal` would fail to send a `NotifyScroll()` to the `TermControl` hosting it.

For this bug to repro, we need to:
- Have a sufficiently large buffer, because each newline we'll accumulate a delta of (0, ~bufferHeight), so (bufferHeight^2 + bufferHeight) > SHRT_MAX
- Have a selection

## Validation Steps Performed
* Dustin verified this actually
* Created a new insane test case
2020-04-29 19:28:59 +00:00
Carlos Zamora 6d4107206a
Notify UIA when Search finds something (#5478)
## Summary of the Pull Request
Before this, if the Search Box was open, new selections would not notify automation clients. This was because the UiaEngine (responsible for notifying automation clients) would remain disabled. Now we're enabling it before the early exit in TermControl's FocusHandler

## PR Checklist
* [X] Will close issue #5421 upon verification

## Validation Steps Performed
Verified using NVDA.
Narrator's behavior is not impacted, for some reason.
2020-04-29 10:36:45 -07:00
Carlos Zamora db5d2fe0a5
Add and enforce minimum width (#5599)
## Summary of the Pull Request
Enforces a minimum width of 460 wide. This allows tabs to always be seen (albeit partially).

NOTE: A minimum height was originally added to allow the About menu to be seen. This minimum height was removed from this PR because we don't foresee a circumstance where your Terminal is in that state, and you can't just resize it to make the content fit properly.

## References
#4990 may be fixed/affected by this?

## PR Checklist
* [X] Closes #4976 
* [X] Will close issue #5418 upon verification

## Validation Steps Performed
Here's some images of what the terminal looks like when it's at its minimum size:

### 100% scaling

#### 100% scaling: one tab
![100% scaling: one tab](https://user-images.githubusercontent.com/11050425/80408686-76e0fd00-887c-11ea-8283-35871d24652a.png)

#### 100% scaling: two tabs
![100% scaling: two tabs](https://user-images.githubusercontent.com/11050425/80408695-79435700-887c-11ea-9670-116cde320e07.png)

#### 100% scaling: 3 tabs (scrolling enabled)
![100% scaling: 3 tabs (scrolling enabled)](https://user-images.githubusercontent.com/11050425/80408701-7c3e4780-887c-11ea-8ede-8b69d20d6f66.png)


### 200% scaling

#### 200% scaling: one tab
![200% scaling: one tab](https://user-images.githubusercontent.com/11050425/80408783-9a0bac80-887c-11ea-8b62-bd064f89403d.png)

#### 200% scaling: two tabs
![200% scaling: two tabs](https://user-images.githubusercontent.com/11050425/80408793-9c6e0680-887c-11ea-9301-344189281006.png)

#### 200% scaling: 3 tabs (scrolling enabled)
![200% scaling: 3 tabs (scrolling enabled)](https://user-images.githubusercontent.com/11050425/80408799-9ed06080-887c-11ea-892a-ee8e329080c5.png)
2020-04-28 23:24:21 +00:00
Leonard Hecker 9247ff081b
Fix Ctrl+Alt not being treated as a substitute for AltGr anymore (#5552)
This PR fixes #5525 by re-adding range checks that were erroneously removed in
a9c9714.

## Validation Steps Performed

* Enabled a German keyboard layout
* Entered `<`, `+`, `7`, `8`, `9`, `0` while holding either Alt+Ctrl or AltGr and...
* Ensuring that both produce `|`, `~`, `{`, `[`, `]`, `}`

Closes #5525
2020-04-28 15:27:43 -07:00
Leon Liang e358b96746
Add a Third-Party notices link to the about dialog (#5508)
## Summary of the Pull Request
This PR will add a link to the version of `NOTICE.md` in GitHub at the commit that the build was on. It uses the same approach for generating our settings files, where we'll create a header file with the commit hash assigned to a `wstring_view` during build time.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #5139
* [x] CLA signed.
* [x] Tests added/passed

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
The link is there and goes to the expected `NOTICE.md`.
2020-04-28 20:22:44 +00:00
Carlos Zamora 9e23ee7fd6
doc: clean up the schema (#5304)
## Summary of the Pull Request
This PR performs a number of miscellaneous clean-up tasks on our schema:
- [X] allow null for some settings
- [X] update some default values to be more useful
- [X] consistently use " instead of '
- [X] remove colorTable
- [X] provide missing description for `backgroundImageOpacity`
- [X] update cursorShape to have options match order displayed in vs code
- [X] if a setting has multiple options, provide a list of those options with a short description on each
   - this one I only did a few times
- [X] remove a little bit of ambiguity on some descriptions

## PR Checklist
Closes #5279

## Detailed Description of the Pull Request / Additional comments
Validation was performed for...
- [X] Global Settings
- [X] Profile Settings
- [x] Keybinding Actions


## Validation Steps Performed
I linked VS Code to the my version of the schema. Defined all settings from scratch in settings.json. Anytime I found something off, I updated the schema and saw if it looks right.
2020-04-28 12:14:30 -07:00
Leon Liang 64f8bbf5ff
Adjust TSFInputControl alignment (#5609)
This PR fixes a couple of issues with TSFInputControl alignment:

1. The emoji picker IME in particular would show up overlapping the
   current buffer row because I stupidly didn't realize that
   `TextBlock.ActualHeight` is 0 right after initialization and before
   it has any text. So, the emoji picker will show up on the bottom of
   the 0 height TextBlock, which overlaps the current buffer row. This
   isn't a problem with CJK because inputting text _causes_ the IME to
   show up, so by the time the IME shows up, the TextBlock has text and
   accordingly has a height.
2. It turns out the emoji picker IME doesn't follow the `TextBlock`
   bottom, unlike Chinese and Japanese IME, so if a user were to compose
   near the edge of the screen and let the `TextBlock` start line
   wrapping, the emoji IME doesn't follow the bottom of the `TextBlock`
   as it grows. This means that the `TextBlock` position doesn't update
   in the middle of composition, and the `LayoutRequested` event that it
   fires at the beginning of composition is the only chance we get to
   tell the emoji IME where to place itself. It turns out when we reset
   `TextBlock.Text`, the ActualHeight doesn't get immediately reset back
   to the min size. So if a user were to bring up the emoji IME before
   `ActualHeight` is reset, the IME will show up way below the current
   buffer row.
3. We don't currently `TryRedrawCanvas` when the window position changes
   (resizing, dragging the window around), so sometimes dragging or
   resizing the Terminal doesn't update the position of the IME. Ideally
   it should be listening to some "window position changed" event, but
   alas we don't have that and it would be much harder than this
   incoming fix. We'll just track the window bounds as part of
   `TryRedrawCanvas` and redraw if it changes. For the most part, this
   will allow the IME to update to where the new window position is, but
   it'll only be called if we receive a `LayoutRequested` event.

## PR Checklist
* [x] Closes #5470
* [x] CLA signed.
* [x] Tests added/passed

## Validation Steps Performed
I play with it for quite a bit.
2020-04-28 18:50:33 +00:00
Chester Liu 97d6456476
Improve cluster construction performance (#5584)
<!-- 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

A tiny performance fix in `renderer.cpp`.

<!-- 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

The cluster construction code is intensively called during rendering. Even though a single `back()` is fast, but accumulated `back()`s still take a noticiable amount of CPU cycles.


Before:

![perf1](https://user-images.githubusercontent.com/4710575/80323322-4342aa80-885d-11ea-92fb-06998dcef327.png)

After:

![图片](https://user-images.githubusercontent.com/4710575/80323336-52c1f380-885d-11ea-8244-4d8d432f7c52.png)

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

Manually validated.
2020-04-28 15:41:44 +00:00
Mike Griese d6cae40d26
Add a warning about using the globals property (#5597)
This property was deprecated in 0.11. We probably should have also added a warning
message to help the community figure out that this property is gone and won't work
anymore.

This PR adds that warning.

* I'm not going to list the enormous number of duped threads _wait yes I am_
    * #5581
    * #5547
    * #5555
    * #5557
    * #5573 
    * #5532
    * #5527
    * #5535 
    * #5510
    * #5511
    * #5512
    * #5513
    * #5516
    * #5515
    * #5521 
    * This literally isn't even all of them 

* [x] Also mainly related to #5458
* [x] I work here
* [x] Tests added/passed
2020-04-27 22:20:18 +00:00
Rafael Kitover b4c9c0cfeb
Improve default foregrounds for Tango schemes (#5598)
Followup to ea61aa3b.

The default foreground in the iTerm2 defaults for the Tango Dark color
scheme is too bright, use the value for ANSI 7 (white) instead.

References #5305

Sorry, I should have really done this in the original PR.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-27 15:20:02 -07:00
Dustin L. Howett (MSFT) 8004223500
Actually check the elevation status when disabling tab rearrange (#5542)
Fixes #5564.
2020-04-27 09:17:19 -07:00
Marius Strom 37ff3f9f87
Updating to change from requestedTheme to theme (#5556)
<!-- 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
Simple fix to update the example documentation with the recent changes to 0.11.
2020-04-27 08:57:46 -05:00
Dustin L. Howett (MSFT) 7eb0a26b91
Remove a stray __stdcall that was breaking the x86 build (#5554) 2020-04-24 16:46:01 -07:00