510 Commits

Author SHA1 Message Date
Dustin L. Howett
a46fac25d3
Remove startOnUserLogin from the settings; use OS APIs only (#18530)
Before we had a Settings UI, we added support for a setting called
`startOnUserLogin`. It was a boolean, and on startup we would try to
yeet the value of that setting into the Windows API responsible for
registering us as a startup task.

Unfortunately, we failed to take into account a few things.

- Startup tasks can be independently controlled by the user in Windows
Settings or by an enterprise using enterprise policy
- This control is not limited to *disabling* the task; it also supports
enabling it!

Users could enable our startup task outside the settings file and we
would never know it. We would load up, see that `startOnUserLogin` was
`false`, and go disable the task again. 🤦

Conversely, if the user disables our task outside the app _we can never
enable it from inside the app._ If an enterprise has configured it
either direction, we can't change it either.

The best way forward is to remove it from our settings model and only
ever interact with the Windows API.

This pull request replaces `startOnUserLogin` with a rich settings
experience that will reflect the current and final state of the task as
configured through Windows. Terminal will enable it if it can and
display a message if it can't.

My first attempt at this PR (which you can read in the commit history)
made us try harder to sync the state between the settings model and the
OS; we would propagate the disabled state back to the user setting when
the task was disabled in the OS or if we failed to enable it when the
user asked for it. That was fragile and didn't support reporting the
state in the settings UI, and it seems like it would be confusing for a
setting to silently turn itself back off anyway...

Closes #12564
2025-02-20 16:53:33 -06:00
Josh Johnson
27f775ee9e
Add the ability to show the tab bar in fullscreen (#18171)
This PR allows users to enable the tab bar in fullscreen mode.

A new setting; "showTabsFullscreen"; has been added which accepts a
boolean value. When `true`, then the tab bar will remain visible when
the terminal app is fullscreen. If the value is `false` (default), then
the tab bar is hidden in fullscreen.

When the tab bar is visible in fullscreen, the min/max/close controls
are hidden to maintain the expected behaviour of a fullscreen app.

## Validation Steps Performed
All unit tests are passing.

Manually verified that when the "launchMode" setting is "fullscreen" and
the "showTabsFullscreen" setting is `true`, the tab bar is visible on
launch.

Manually verified that changing the setting at runtime causes the tab
bar to be shown/hidden immediately (if the terminal is currently
fullscreen).

Manually verified that the new "showTabsFullscreen" setting is honoured
regardless of whether "showTabsInTitlebar" is set to `true` or `false`.

Closes #11130
2025-01-30 13:53:43 -08:00
Tarang Janawalkar
8a806e0ac9
Clear up the schema description for experimental.rightClickContextMenu (#18388)
It did not cover all of the right-click behaviors.
2025-01-28 17:43:33 -06:00
Dustin L. Howett
33556fb631
Let folks disable OSC 52 (#18449)
This pull request introduces a new profile setting,
`compatibility.allowOSC52`, which defaults to `true`. When disabled, it
will not allow applications to write to the clipboard.

Security-minded folks may choose to disable it.
2025-01-23 18:28:02 -06:00
Carlos Zamora
8598ed78d5
Add "Windows.Terminal.VisualStudio" to schema (#18322)
Closes #18037
2024-12-13 12:40:25 -08:00
Leonard Hecker
8bbf00e054
Remove Monarch/Peasant & Make UI single-threaded (#18215)
As before, a minor refactor:
* I started off by removing the Monarch/Peasant with the goal of moving
  it into and deduplicating its functionality with `WindowEmperor`.
* Since I needed a replacement for the Monarch (= ensures that there's
  a single instance), I wrote single-instance code with a NT mutex
  and by yeeting data across processes with `WM_COPYDATA`.
* This resulted in severe threading issues, because it now started up
  way faster. The more I tried to solve them the deeper I had to dig,
  because you can't just put a mutex around `CascadiaSettings`.
  I then tried to seeif WinUI can run multiple windows on a single
  thread and, as it turns out, it can.
  So, I removed the multi- from the window threading.
* At this point I had dig about 1 mile deep and brought no ladder.
  So, to finish it up, I had to clean up the entire eventing system
  around `WindowEmperor`, cleaned up all the coroutines,
  and cleaned up all the callbacks.

Closes #16183
Closes #16221
Closes #16487
Closes #16532
Closes #16733
Closes #16755
Closes #17015
Closes #17360
Closes #17420
Closes #17457
Closes #17799
Closes #17976
Closes #18057
Closes #18084
Closes #18169
Closes #18176
Closes #18191

## Validation Steps Performed
* It does not crash 
* New/close tab 
* New/close window 
* Move tabs between windows 
* Split tab into new window 
* Persist windows on exit / restore startup 
2024-12-12 22:21:24 +01:00
Michael Xu
7cdf9eeafb
Open current working directory action. (#18013)
## Summary of the Pull Request
Added open current directory action.
## References and Relevant Issues
Need to set this:
https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed
- Ensure shell has been configured
- Run "Open current working directory" action in command palette
- File explorer opens the correct directory

## PR Checklist
- [x] Closes #12859
- [ ] Tests added/passed
- [ ] Documentation updated
- If checked, please file a pull request on [our docs
repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
- [ ] Schema updated (if necessary)
2024-12-05 04:18:45 -08:00
Leonard Hecker
c0d40c9768
Update settings schema for compatibility.textMeasurement (#18277)
It seems I forgot to add this in #16916.
2024-12-04 18:03:42 -06:00
Josh Soref
774f74258f
ci: upgrade to check-spelling v0.0.24 (#18261)
This upgrades to [check-spelling v0.0.24].

A number of GitHub APIs are being turned off shortly, so we need to
upgrade or various uncertain outcomes will occur.

There are some minor bugs that I'm aware of and which I've fixed since
this release (including a couple I discovered while preparing this PR).

There's a new accessibility forbidden pattern:

#### Should be `cannot` (or `can't`)

See https://www.grammarly.com/blog/cannot-or-can-not/
> Don't use `can not` when you mean `cannot`. The only time you're
likely to see `can not` written as separate words is when the word `can`
happens to precede some other phrase that happens to start with `not`.
> `Can't` is a contraction of `cannot`, and it's best suited for
informal writing.
> In formal writing and where contractions are frowned upon, use
`cannot`.
> It is possible to write `can not`, but you generally find it only as
part of some other construction, such as `not only . . . but also.`
- if you encounter such a case, add a pattern for that case to
patterns.txt.
```
\b[Cc]an not\b
```

[check-spelling v0.0.24]: https://github.com/check-spelling/check-spelling/releases/tag/v0.0.24

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2024-12-04 12:06:31 -06:00
Leonard Hecker
32eeefd89e
Add 10.0.26100.0 to MaxVersionTested (#18252)
As it turns out, you cannot use `<uap17:UpdateWhileInUse>`
(or any other newer namespace) unless you declare a corresponding
`MaxVersionTested` in your package manifest.
It does not appear that there's a reason for this, it just is.
`MaxVersionTested` is not to be confused with the `maxversiontested`,
which is something else entirely, but I updated it for safe measure.
Since `maxversiontested` is not a "max", but rather a list
of tested versions, it gets appended to the end of the list.

Closes #18119
2024-12-03 14:37:34 -06:00
Josh Soref
56dc9d1f98
Remove references to fabricbot (#18258)
Refs #18251
2024-12-02 12:23:52 -06:00
Danny Weinberg
282670a092
Allow copying with ANSI escape code control sequences (#17059)
## Summary of the Pull Request

This extends the copy command to be able to include control sequences,
for use in tools that subsequently know how to parse and display that.

## References and Relevant Issues

https://github.com/microsoft/terminal/issues/15703

## Detailed Description of the Pull Request / Additional comments

At a high level, this:
- Expands the `CopyTextArgs` to have a `withControlSequences` bool.
- Plumbs that bool down through many layers to where we actuall get
  data out of the text buffer.
- Modifies the existing `TextBuffer::Serialize` to be more generic
  and renames it to `TextBuffer::ChunkedSerialize`.
- Uses the new `ChunkedSerialize` to generate the data for the copy
  request.

## Validation Steps Performed

To test this I've manually:
- Generated some styled terminal contents, copied it with the control
  sequences, pasted it into a file, `cat`ed the file and seen that it
  looks the same.
- Set `"firstWindowPreference": "persistedWindowLayout"` and
  validated that the contents of windows are saved and
  restored with styling intact.

I also checked that `Invoke-OpenConsoleTests` passed.

## PR Checklist
- [x] Closes #15703
- [ ] Tests added/passed
- [x] Documentation updated
- If checked, please file a pull request on [our docs
repo](https://github.com/MicrosoftDocs/terminal) and link it here:
https://github.com/MicrosoftDocs/terminal/pull/756
- [x] Schema updated (if necessary)
2024-11-20 17:03:04 +01:00
Dustin L. Howett
068906714f
Add a new (advanced) profile setting, pathTranslationStyle (#18195)
`pathTranslationStyle` has four options:

- `none`: Do no translation
- `wsl`: Translate `C:\` to `/mnt/c` and `\\wsl$\Foo\bar` to `/bar`
- `cygwin`: Translate `C:\` to `/cygdrive/c`
- `msys2`: Translate `C:\` to `/c`

It is intended as a broadly-supported replacement for us checking the
source every time the user drops a path.

We no longer need to push the source name all the way down to the
control.

I am hesitant to commit to using other folks' product names in our
settings model,
however, these are almost certainly more recognizable than whatever
other weird
names we could come up with.

The Git Bash fragment extension profile could conceivably use
`pathTranslationStyle`
`msys2` to make sure drag/dropped paths look right.
2024-11-15 23:55:34 +00:00
Josh Johnson
5b63465798
Add icon override setting for newTabMenu entries (#18116)
## Summary of the Pull Request
This PR is to allow users to set a custom icon for entries in the new tab menu for "action" and "profile" type entries.

## References and Relevant Issues
This PR is in response to #18103 

## Detailed Description of the Pull Request / Additional comments
It is now possible to specify an optional "icon" setting for any "action" or "profile" type entry in the "newTabMenu" JSON settings. When specified, this icon will be used as the menu icon for that action/profile in the new tab menu. If not specified, the action/profile definition's default icon will be used instead (if present).

The Cascadia settings schema ("doc/cascadia/profiles.schema.json") has been updated to reflect this.

## Validation Steps Performed
Manually tested with multiple combinations of icon settings:
- ActionEntry:
  - valid path in action definition and new tab entry (renders new tab entry icon)
  - valid path in action definition but no path in new tab entry (renders action definition icon)
  - no path in action definition, valid path in new tab entry (renders new tab entry icon)
  - invalid path in action definition, valid path in new tab entry (renders new tab entry icon)
  - valid path in action definition, invalid path in new tab entry (renders no icon)
  - invalid path in both (renders no icon)
  - no path in both (renders no icon)
- ProfileEntry:
  - valid path in new tab entry (renders new tab entry icon)
  - no path in new tab entry (renders profile's default icon)
  - invalid path in new tab entry (renders no icon)

## PR Checklist
- [x] Closes #18103
- [x] Tests added/passed
- [x] Documentation updated
   - If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: [#808](https://github.com/MicrosoftDocs/terminal/pull/808)
- [x] Schema updated (if necessary)
2024-10-29 11:45:19 -07:00
Carlos Zamora
18d86bca09
Add a Compatibility and Terminal page to the Settings UI (#17895)
## Summary of the Pull Request
Adds a global Compatibility page to the settings UI. This page exposes
several existing settings and introduces a few new settings:
- compatibility.allowHeadless
- compatibility.isolatedMode
- compatibility.textMeasurement
- debugFeatures

This also adds a Terminal subpage for profiles in the settings UI. This
page includes:
- suppressApplicationTitle
- compatibility.input.forceVT
- compatibility.allowDECRQCRA
- answerbackMessage

Several smaller changes were accomplished as a part of this PR:
- `experimental.input.forceVT` was renamed to
`compatibility.input.forceVT`
- introduced the `compatibility.allowDECRQCRA` setting
- updated the schema for these new settings and
`compatibility.allowHeadless` (which was missing)
- add `Feature_DebugModeUI` feature flag to control if debug features
should be shown in the SUI

Verified accessible via Accessibility Insights

A part of #10000
Closes #16672
2024-10-10 23:54:31 +00:00
Carlos Zamora
37aba3157c
Add Warnings to Settings UI (#17933)
Adds the following settings to the Interaction page under a Warnings subsection:
- ConfirmCloseAllTabs
- InputServiceWarning
- WarnAboutLargePaste
- WarnAboutMultiLinePaste

This also changes the JSON keys of those settings to be in the `warning` namespace as a QOL change for JSON users. We still handle the legacy keys, don't worry 😉.

#10000
2024-09-25 10:10:24 -07:00
Mike Griese
fd1b1c35b4
Set the default for autoMarkPrompts to true (#17761)
As we discussed in bug bash.

There's really no downside to us enabling it by default (and leaving
showMarksOnScrollbar: false). It'll mark lines as "prompts" when the
user hits enter. This will have a couple good side effects:
* When folks have right-aligned prompts (like, from oh-my-posh), the
`enter` will terminate where shell integration thinks the command is, so
that the right-prompt doesn't end up in the commandline history
* the scrollToMark actions will Just Work without any other shell
integration

Closes #17632
2024-08-21 17:07:06 -05:00
Carlos Zamora
1511d2c2ad
schema: add reloadEnvironmentVariables to newTerminalArgs (#17696) 2024-08-14 15:16:04 -05:00
James Holderness
746cf1f148
Add support for the VT answerback capability (#17660)
The answerback feature allows for the user to define a message that the
terminal will transmit to the host whenever an `ENQ` (enquiry) control
character is received.

## Detailed Description of the Pull Request / Additional comments

In Windows Terminal, the message can be configured at the profile level
of the settings file, as a string property named `AnswerbackMessage`.

In ConHost, the message can be configured in the registry, again as a
string value with the name `AnswerbackMessage`.

## Validation Steps Performed

I've confirmed that the control is working as intended in both Windows
Terminal and ConHost using Vttest.

Closes #11946
2024-08-07 17:46:01 -05:00
Leonard Hecker
d730cfda9f
Add a spec for an In-process ConPTY (#17387)
👉 Preview:
https://github.com/microsoft/terminal/blob/dev/lhecker/13000-spec/doc/specs/%2313000%20-%20In-process%20ConPTY.md

The spec has a tl;dr! The tl;dr^2 for the commit message:
* Less bugs
* Less code
* More perf
2024-07-30 11:35:42 -05:00
Leonard Hecker
ac5b4f5831
Use VT for COOKED_READ_DATA (#17445)
By rewriting `COOKED_READ_DATA` to use VT for its output we make it
possible to pass this VT output 1:1 straight to the hosting terminal
if we're running under ConPTY. This is also possible with the current
console APIs it uses, but it's somewhat janky. In particular the
usage of `ReadConsoleOutput` to backup/restore the popup contents
could be considered bad faith "rules for thee, not for me",
given that we're telling people to move away from those APIs.

The new implementation contains a bare bones "pager" to fit even
very long prompt contents into the VT viewport.
I fully expect this initial PR to not be entirely bug free, because
writing a proper pager with line wrapping is a little bit complex.
This PR takes some significant shortcuts by leveraging the fact
that the prompt line is always left-to-right and always a series
of fully filled lines followed by one potentially semi-full line.
This allows us to skip using a front/back-buffer for diffing the
contents between two redisplay calls.

Part of #14000

## Validation Steps Performed
* ASCII input
* Chinese input (中文維基百科) 
* Surrogate pair input (🙂) 
* In cmd.exe
  * Create 2 files: "a😊b.txt" and "a😟b.txt"
  * Press tab: Autocomplete to "a😊b.txt" 
  * Navigate the cursor right past the "a"
  * Press tab twice: Autocomplete to "a😟b.txt" 
* Execute `printf("    "); gets(buffer);` in C (or equivalent)
  * Press Tab, A, Ctrl+V, Tab, A 
  * The prompt is "        A^V     A" 
  * Cursor navigation works 
  * Backspacing/Deleting random parts of it works 
  * It never deletes the initial 4 spaces 
* Backspace deletes preceding glyphs 
* Ctrl+Backspace deletes preceding words 
* Escape clears input 
* Home navigates to start 
* Ctrl+Home deletes text between cursor and start 
* End navigates to end 
* Ctrl+End deletes text between cursor and end 
* Left navigates over previous code points 
* Ctrl+Left navigates to previous word-starts 
* Right and F1 navigate over next code points 
  * Pressing right at the end of input copies characters
    from the previous command 
* Ctrl+Right navigates to next word-ends 
* Insert toggles overwrite mode 
* Delete deletes next code point 
* Up and F5 cycle through history 
  * Doesn't crash with no history 
  * Stops at first entry 
* Down cycles through history 
  * Doesn't crash with no history 
  * Stops at last entry 
* PageUp retrieves the oldest command 
* PageDown retrieves the newest command 
* F2 starts "copy to char" prompt 
  * Escape dismisses prompt 
  * Typing a character copies text from the previous command up
    until that character into the current buffer (acts identical
    to F3, but with automatic character search) 
* F3 copies the previous command into the current buffer,
  starting at the current cursor position,
  for as many characters as possible 
  * Doesn't erase trailing text if the current buffer
    is longer than the previous command 
  * Puts the cursor at the end of the copied text 
* F4 starts "copy from char" prompt 
  * Escape dismisses prompt 
  * Erases text between the current cursor position and the
    first instance of a given char (but not including it) 
* F6 inserts Ctrl+Z 
* F7 without modifiers starts "command list" prompt 
  * Escape dismisses prompt 
  * Entries wider than the window width are truncated 
  * Height expands up to 20 rows with longer histories 
  * F9 starts "command number" prompt 
  * Left/Right replace the buffer with the given command 
    * And put cursor at the end of the buffer 
  * Up/Down navigate selection through history 
    * Stops at start/end with <10 entries 
    * Stops at start/end with >20 entries 
    * Scrolls through the entries if there are too many 
  * Shift+Up/Down moves history items around 
  * Home navigates to first entry 
  * End navigates to last entry 
  * PageUp navigates by $height items at a time or to first 
  * PageDown navigates by $height items at a time or to last 
* Alt+F7 clears command history 
* F8 cycles through commands that start with the same text as
  the current buffer up until the current cursor position 
  * Doesn't crash with no history 
* F9 starts "command number" prompt 
  * Escape dismisses prompt 
  * Ignores non-ASCII-decimal characters 
  * Allows entering between 1 and 5 digits 
  * Pressing Enter fetches the given command from the history 
* Alt+F10 clears doskey aliases 
* In cmd.exe, with an empty prompt in an empty directory:
  Pressing tab produces an audible bing and prints no text 
* When Narrator is enabled, in cmd.exe:
  * Typing individual characters announces only
    exactly each character that is being typed 
  * Backspacing at the end of a prompt announces
    only exactly each deleted character 
2024-07-11 20:11:44 +00:00
PankajBhojwani
ec9289288e
Fix schema and user defaults from Action ID change (#17509)
- Remove the `deprecated` flag for the `keybindings` array now that we
have re-added that
- Update `userDefaults` to use the correct ID for the `Copy` command
2024-07-03 13:56:30 +00:00
Mike Griese
8511f3d737
Add a spec for "Snippets" (#17329)
This specs out a lot of plans for snippets. We've already got these in
the sxnui as "tasks", but we can do so very much more.

This spec is a few years old now, but it's time for it to get promoted
out of my draft branch.

References: 
* #1595
* #7039
* #3121
* #10436
* #12927
* #12857
* #5790
* #15845

---------

Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
2024-06-22 11:03:04 +00:00
Carlos Zamora
125738b63e
Add Spec for Quick Fix (#17005)
Quick Fix will be a new UI surface that allows the user to interact with
the terminal and leverage the context of a specific command being
executed. This new UI surface will be a home for features like WinGet
Command Not Found.

#16599
2024-06-11 13:37:09 -05:00
PankajBhojwani
aeed0782bc
Allow actions in the new tab dropdown (#17281)
Allows the user to define entries in the new tab menu that execute
actions, based on their action Id

Closes #3759
Closes #9362
2024-06-06 22:17:18 +00:00
PankajBhojwani
ece0c04c38
Refactor ActionMap and Command to use ActionIDs (#17162)
As outlined in #16816, refactor `ActionMap` to use the new action IDs
added in #16904

## Validation steps performed

- [x] Legacy style commands are parsed correctly (and rewritten to the
new format)
- [x] Actions are still layered correctly and their IDs can be used to
'overwrite' actions in earlier layers
- [x] Keybindings that refer to an ID defined in another layer work
correctly
- [x] User-defined actions without an ID have one generated for them
(and their settings file is edited with it)
- [x] Schema updated

Refs #16816 
Closes #17133
2024-06-04 00:23:51 +00:00
Mike Griese
8dd4512067
Some schema updates for 1.21 (#17183)
Noticed all these while prepping for Build:

* Promotes the stabilized features out of `experimental.`
* fixes a bug where a nested command with a `name` would match to a
`renameWindow` action, instead of a command.
* Adds the tab theme icon style
* fixes a bug where `ScrollToMarkAction` wasn't in the list of possible
args, so they would incorrectly get flagged as `moveTab`
* outright adds `experimental.rightClickContextMenu` which was missing
(?)
2024-05-02 14:15:25 -05:00
Leonard Hecker
d3803943ca
Fix font axes/features settings UI (#17164)
Due to #16821 everything about #16104 broke. This PR rights the wrongs
by rewriting all the `Font`-based code to not use `Font` at all.
Instead we split the font spec once into font families, do a lot of
complex logic to split font axes/features into used and unused ones
and construct all the UI elements. So. much. boilerplate. code.

Closes #16943

## Validation Steps Performed
There are more edge cases than I can list here... Some ideas:
* Edit the settings.json with invalid axis/feature keys 
* ...out of range values 
* Settings UI reloads when the settings.json changes 
* Adding axes/features works 
* Removing axes/features works 
* Resetting axes/features works 
* Axes/features apply in the renderer when saving 
2024-05-01 17:09:20 +00:00
PankajBhojwani
378b6594bd
Add action ID to schema (#17146)
Closes #17122
2024-04-26 16:34:01 -07:00
Leonard Hecker
4e7b63c664
A minor TSF refactoring (#17067)
Next in the popular series of minor refactorings:
Out with the old, in with the new!

This PR removes all of the existing TSF code, both for conhost and
Windows Terminal. conhost's TSF implementation was awful:
It allocated an entire text buffer _per line_ of input.
Additionally, its implementation spanned a whopping 40 files and
almost 5000 lines of code. Windows Terminal's implementation was
absolutely fine in comparison, but it was user unfriendly due to
two reasons: Its usage of the `CoreTextServices` WinRT API indirectly
meant that it used a non-transitory TSF document, which is not the
right choice for a terminal. A `TF_SS_TRANSITORY` document (-context)
indicates to TSF that it cannot undo a previously completed composition
which is exactly what we need: Once composition has completed we send
the result to the shell and we cannot undo this later on.
The WinRT API does not allow us to use `TF_SS_TRANSITORY` and so it's
unsuitable for our application. Additionally, the implementation used
XAML to render the composition instead of being part of our text
renderer, which resulted in the text looking weird and hard to read.

The new implementation spans just 8 files and is ~1000 lines which
should make it significantly easier to maintain. The architecture is
not particularly great, but it's certainly better than what we had.
The implementation is almost entirely identical between both conhost
and Windows Terminal and thus they both also behave identical.
It fixes an uncountable number of subtle bugs in the conhost TSF
implementation, as it failed to check for status codes after calls.
It also adds several new features, like support for wavy underlines
(as used by the Japanese IME), dashed underlines (the default for
various languages now, like Vietnamese), colored underlines,
colored foreground/background controlled by the IME, and more!

I have tried to replicate the following issues and have a high
confidence that they're resolved now:
Closes #1304
Closes #3730
Closes #4052
Closes #5007  (as it is not applicable anymore)
Closes #5110
Closes #6186
Closes #6192
Closes #13805
Closes #14349
Closes #14407
Closes #16180

For the following issues I'm not entirely sure if it'll fix it,
but I suspect it's somewhat likely:
#13681
#16305
#16817

Lastly, there's one remaining bug that I don't know how to resolve.
However, that issue also plagues conhost and Windows Terminal
right now, so it's at least not a regression:
* Press Win+. (emoji picker) and close it
* Move the window around
* Press Win+.

This will open the emoji picker at the old window location.
It also occurs when the cursor moves within the window.
While this is super annoying, I could not find a way to fix it.

## Validation Steps Performed
* See the above closed issues
* Use Vietnamese Telex and type "xin choaf"
  Results in "xin chào" 
* Use the MS Japanese IME and press Alt+`
  Toggles between the last 2 modes 
* Use the MS Japanese IME, type "kyouhaishaheiku", and press Space
  * The text is converted, underlined and the first part is
    doubly underlined 
  * Left/Right moves between the 3 segments 
  * Home/End moves between start/end 
  * Esc puts a wavy line under the current segment 
* Use the Korean IME, type "gksgks"
  This results in "한한" 
* Use the Korean IME, type "gks", and press Right Ctrl
  Opens a popup which allows you to navigate with Arrow/Tab keys 
2024-04-18 17:47:28 +00:00
Mike Griese
ad0b67239d
Add some docs on how to resolve DEP0700 errors in VS (#16997)
This happens to me once a month, and I finally solved it.
2024-04-02 10:07:33 -07:00
Leonard Hecker
2050416997
Remove VtApiRoutines (#16954)
This removes `VtApiRoutines` and the VT passthrough mode.
Why? While VT passthrough mode has a clear advantage (doesn't corrupt
VT sequences) it fails to address other pain points (performance,
out-of-sync issues after resize, etc.). Alternative options are
available which have less restrictions.
Why now? It's spring! Spring cleanup!
2024-03-28 18:22:39 +00:00
Leonard Hecker
a67a13288c
AtlasEngine: Make Direct2D/3D and Present1 configurable (#16939)
This implements `SetForceFullRepaintRendering` and adds a new
`SetGraphicsAPI` function. The former toggles `Present1` on and off
and the latter allows users to explicitly request Direct2D/3D.

On top of these changes I did a minor cleanup of the interface,
because now that DxRenderer is gone we don't need all that anymore.

Closes #14254
Closes #16747

## Validation Steps Performed
* Toggling Direct2D on/off changes colored ligature support 
* Toggling Present1 on/off can be observed in a debugger 
* Toggling WARP on/off changes GPU metrics 

---------

Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
2024-03-26 21:31:24 +00:00
PankajBhojwani
7f02b25437
spec: update the spec for Action IDs (#16816)
As we start to work on implementing Action IDs, the spec written a few
years ago needs some updates. This PR makes those updates for the
current implementation plan.

References #6899
2024-03-09 13:11:50 -06:00
Leonard Hecker
bf25595961
Remove DxEngine (#16278)
With AtlasEngine being fairly stable at this point and being enabled
by default in the 1.19 branch, this changeset removes DxEngine.

## Validation Steps Performed
* WT builds and runs 
* WpfTestNetCore 
* Saving the config removes the `useAtlasEngine` key 
2024-02-21 23:50:59 +00:00
Sarim Khan
d3a18b9041
schema: add experimental.repositionCursorWithMouse (#16652)
Add experimental.repositionCursorWithMouse to profiles.schema.json. So
when editing settings.json with vscode, it autocompletes and don't
complain.
2024-02-09 14:31:29 -06:00
Dustin L. Howett
71c35cf24c
Add a spec for #7335, "console allocation policy" (#7337)
This is a specification for a way to customize console allocations.
The new manifest type `consoleAllocationPolicy` and the new
`AllocConsoleWithOptions` API were already added to the console
client library internally.

Closes #7335
2024-02-07 07:48:52 -06:00
Josh Soref
dc986e4489
Check spelling 0.0.22 (#16127)
Upgrades check-spelling to [v0.0.22](https://github.com/check-spelling/check-spelling/releases/tag/v0.0.22)

* refreshes workflow
* enables dependabot PRs to trigger CI (so that in the future you'll be
able to see breaking changes to the dictionary paths)
* refreshes metadata
* built-in handling of `\n`/`\r`/`\t` is removed -- This means that the
`patterns/0_*.txt` files can be removed.
* this specific PR includes some shim content, in
`allow/check-spelling-0.0.21.txt` -- once it this PR merges, it can be
removed on a branch and the next CI will clean out items from
`expect.txt` relating to the `\r` stuff and suggest replacement content.
* talking to the bot is enabled for forks (but not the master
repository)
* SARIF reporting is enabled for PRs w/in a single repository (not
across forks)
* In job reports, there's a summary table (space permitting) linking to
instances (this is a poor man's SARIF report)
* When a pattern splits a thing that results in check-spelling finding
an unrecognized token, that's reported with a distinct category
* When there are items in expect that not longer match anything but more
specific items do (e.g. `microsoft` vs. `Microsoft`), there's now a
specific category with help/advice
* Fancier excludes suggestions (excluding directories, file types, ...)
* Refreshed dictionaries
* The comment now links to the job summary (which includes SARIF link if
available, the details view, and a generated commit that people can use
if they're ok w/ the expect changes and don't want to run perl)

Validation
----------

1. the branch was developed in
https://github.com/check-spelling-sandbox/terminal/actions?query=branch%3Acheck-spelling-0.0.22
2. ensuring compatibility with 0.0.21 was done in
https://github.com/check-spelling-sandbox/terminal/pull/3
3. this version has been in development for a year and has quite a few
improvements, we've been actively dogfooding it throughout this period 😄

Additional Fixes
----------------
spelling: the
spelling: shouldn't
spelling: no
spelling: macos
spelling: github
spelling: fine-grained
spelling: coarse-grained

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-12-05 15:40:23 -08:00
debghs
f9652983f1
Minor grammar fixes for the vintage AddASetting.md doc (#16188)
## Summary of the Pull Request
Added some Punctuation Marks as Required.
## References and Relevant Issues
None.
## Detailed Description of the Pull Request / Additional comments
There were some missing Punctuation Marks(Ex: Colon(:) and Full
Stop(.)), so I have added them.
## Validation Steps Performed
2023-12-05 15:39:00 -06:00
Leonard Hecker
654b755161
Fix backspacing over control visualizers (#16400)
During `!measureOnly` the old code would increment `distance` twice.
Now it doesn't. :)

Closes #16356

## Validation Steps Performed
See updated test instructions in `doc/COOKED_READ_DATA.md`
2023-12-04 14:14:26 -06:00
Leonard Hecker
130c9fbd76
Remove unused Utf8ToWideCharParser (#16392)
I randomly came across this class, that I didn't even remember we had.
We don't use this class at the moment and won't need it any time soon.
Its current implementation is also fairly questionable. While
`til::u16state` isn't "perfect", it's vastly better than this.
2023-11-30 15:52:39 +01:00
Marcel Wagner
3b5e5cf5f1
Update paths to use linking within repo instead of github URL (#16358)
Update paths to use relative linking instead of static GitHub link. Also
fixes some dead links

Closes #16338
2023-11-27 15:41:17 -08:00
Leonard Hecker
7a8dd90294
Fix tabs being printed in cmd.exe prompts (#16273)
A late change in #16105 wrapped `_buffer` into a class to better track
its dirty state, but I failed to notice that in this one instance we
intentionally manipulated `_buffer` without marking it as dirty.
This fixes the issue by adding a call to `MarkAsClean()`.

This changeset also adds the test instructions from #15783 as a
document to this repository. I've extended the list with two
bugs we've found in the implementation since then.

## Validation Steps Performed
* In cmd.exe, with an empty prompt in an empty directory:
  Pressing tab produces an audible bing and prints no text 
2023-11-07 11:51:13 -06:00
Leonard Hecker
0b9f041706
Fix issues and warnings caused by profiles.schema.json (#16103)
This addresses the following issues:
* The JSON Schema spec doesn't actually define whether objects with
  a "properties" key still require `"type": "object"` or not.
  VS Code for instance largely pretends as if it's implied, but when it
  encounters them inside a `oneOf` tree, then it behaves as if it isn't.
  In other words, we need to always set `"type": "object"`.
* Declaring an `oneOf` containing a `"type": "string"` and an `enum`
  doesn't work, because if one of the `enum` cases is given, it results
  in both variants to match, since any `enum` is also a `string`.
  We have to use `anyOf` instead.
* `SuggestionSource` used `"BuiltinSuggestionSource"` inside a `type`
  key which doesn't work. We have to use `$ref` for that.

Closes #13387

## Validation Steps Performed
* VS Code stops complaining 
* https://www.jsonschemavalidator.net/ 
2023-10-13 15:44:14 -05:00
Jaswir
27e1081c8c
Allow Opacity to be set differently in both focused and unfocused terminals (#15974)
## Summary of the Pull Request
Closes #11092 

Allowing `opacity `to be set differently in both focused and unfocused
terminals

## References and Relevant Issues
#11092 , references: #7158 

## Detailed Description of the Pull Request / Additional comments

### Allowing Opacity to be set differently in both focused and unfocused
terminals:

![unfocused_opacity](https://github.com/microsoft/terminal/assets/15957528/1c38e40b-4678-43ec-b328-ad79d222579f)

![image](https://github.com/microsoft/terminal/assets/15957528/3e3342a8-7908-41db-9c37-26c89f7f2456)


![jolsen](https://github.com/microsoft/terminal/assets/15957528/68553507-d29e-4513-89ce-b1cd305d28b7)


![image](https://github.com/microsoft/terminal/assets/15957528/18864f60-91d0-4159-87da-2b2ee1637a4c)

## `_runtimeFocusedOpacity`

Mike also had to say something about this:
https://github.com/microsoft/terminal/issues/2531#issuecomment-1668442774

Initially I had something like ` _setOpacity(newAppearance->Opacity());`

But with the introduction of unfocused opacity we encounter new
challenges:
When Adjusting the Opacity with **CTRL+SHIFT+Mouse Scroll Wheel** or
**Set background opacity** in command pallette, the Runtime opacity
changes, but when we go to unfocused and back to focused the opacity
changes back to focused opacity in Settings.

Also when adjusting opacity through the command palette the window
becomes unfocused and then focused again after setting background
opacity hence the ` _setOpacity(newAppearance->Opacity());` would
override the changes made through command palette

![runtimeFocusedOpacity](https://github.com/microsoft/terminal/assets/15957528/4de63057-d658-4b5e-99ad-7db050834ade)


![command_pallette_focusswitches](https://github.com/microsoft/terminal/assets/15957528/372526eb-cf0c-40f8-a4e5-a0739f1f0e05)

With the introduction of unfocused opacity we encounter new challenges.
The runtime opacity stores both the unfocused opacity and focused
opacity from settings at different moments. This all works well until we
combine this with Adjusting the Opacity with **CTRL+SHIFT+Mouse Scroll
Wheel** or **Set background opacity** in command pallette. This brings
the need for a separate Focused Opacity. When we change the runtime
opacity with scroll wheel or through command pallette this value needs
to be stored separately from the one in settings. So we can change back
to it when going to unfocused mode and back to focused instead of the
focused opacity defined in settings.

## `skipUnfocusedOpacity` solves Opacity going from solid to unfocused
to focused bug:

![skipUnfocusedOpacity_bug](https://github.com/microsoft/terminal/assets/15957528/ecc06dcf-fbef-4fef-a40f-68278fdbfb12)

## Validation Steps Performed

- Checked if unfocused Opacity works well when adjusting opacity through
Mouse Scroll Wheel or Command Palette and in combination with Acrylic as
mentioned in "Detailed Description of the Pull Request / Additional
comments"

## PR Checklist

- [x] Closes #11092 
- [ ] Tests added/passed
- [x] Documentation updated
- If checked, please file a pull request on [our docs
repo](https://github.com/MicrosoftDocs/terminal) and link it
here:(https://github.com/MicrosoftDocs/terminal/pull/714)
- [ ] Schema updated (if necessary)
2023-10-13 15:43:38 -05:00
Mike Griese
d0c228e95a
Spec for the Suggestions UI (#14864)
## Summary of the Pull Request

> ## Abstract
> 
> Multiple related scenarios have come up where it would be beneficial
to display
> actionable UI to the user within the context of the active terminal
itself. This
> UI would be akin to the Intellisense UI in Visual Studio. It appears
right where
> the user is typing, and can help provide immediate content for the
user, based
> on some context. The "Suggestions UI" is this new ephemeral UI within
the
> Windows Terminal that can display different types of actions, from
different
> sources.
> 


## Detailed Description of the Pull Request / Additional comments

_\*<sup>\*</sup><sub>\*</sub> read the spec
<sub>\*</sub><sup>\*</sup>\*_

Similar to #14792, a lot of this code is written. This stuff isn't
checked in though, so I'm presenting formally before I start yeeting PRs
out there.

## PR Checklist
- [x] This is a spec for #1595. It also references:
  * #3121
  * #10436
  * #12927
  * #12863
2023-10-05 09:27:30 -05:00
Carlos Zamora
4382a17352
[Schema] Fix incorrect default value for 'allowEmpty' (#16040) 2023-09-29 05:49:34 -05:00
Dustin L. Howett
059f7701f2
Merge PublicTerminalCore into TermControl (#15992)
This pull request moves HwndTerminal into Microsoft.Terminal.Control.Lib
and removes PublicTerminalCore completely.

Microsoft.Terminal.Control.dll now exports the C API from HwndTerminal.

This adds ~100kb to Microsoft.Terminal.Control.dll and ~1400kb to the
WPF package (per architecture) but with the coming interactivity
platform merge it's going to benefit us big time.
2023-09-20 15:21:55 +00:00
Mike Griese
59248de1e4
Allow inheriting env vars from wt again and other env var changes too (#15897)
This PR is a few things:

* part the first: Convert the `compatibility.reloadEnvironmentVariables`
setting to a per-profile one.
* The settings should migrate it from the user's old global place to the
new one.
  * We also added it to "Profile>Advanced" while I was here.
* Adds a new pair of commandline flags to `new-tab` and `split-pane`:
`--inheritEnvironment` / `--reloadEnvironment`
* On `wt` launch, bundle the entire environment that `wt` was spawned
with, and put it into the `Remoting.CommandlineArgs`, and give them to
the monarch (and ultimately, down to `TerminalPage` with the
`AppCommandlineArgs`). DO THIS ALWAYS.
* As a part of this, we’ll default to _reloading_ if there’s no explicit
commandline set, and _inheriting_ if there is.
* For example, `wt -- cmd` would inherit, and `wt -p “Command Prompt”`
would reload.[^1]
* This is a little wacky, but we’re trying to separate out the
intentions here:
* `wt -- cmd` feels like “I want to run cmd.exe (in a terminal tab)”.
That feels like the user would _like_ environment variables from the
calling process. They’re doing something more manual, so they get more
refined control over it.
* `wt` (or `wt -p “Command Prompt”`) is more like, “I want to run the
Terminal (or, my Command Prompt profile) using whatever the Terminal
would normally do”. So that feels more like a situation where it should
just reload by default. (Of course, this will respect their settings
here)

## References and Relevant Issues

https://github.com/microsoft/terminal/issues/15496#issuecomment-1692450231
has more notes.

## Detailed Description of the Pull Request / Additional comments
This is so VERY much plumbing. I'll try to leave comments in the
interesting parts.

## PR Checklist
- [x] This is not _all_ of #15496. We're also going to do a `-E foo=bar`
arg on top of this.
- [x] Tests added/passed
- [x] Schema updated

[^1]: In both these cases, plus the `environment` setting, of course.
2023-09-19 15:03:24 -05:00
Mike Griese
8daf89e318
Add an openAbout action. (#15990)
Just as it says on the label.
Closes #15986
2023-09-18 11:55:05 -05:00