-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow closing tabs by index #10447
Allow closing tabs by index #10447
Conversation
When running the settings model tests in PowerShell, this is the output I got:
Those paths don't look right to me - I can find the
Also path related - when running
Changing terminal/tools/OpenConsole.psm1 Line 399 in b3b6484
[IO.File]::WriteAllLines("$root/$file", $content) seemed to fix that, though I assumed you wouldn't want that change in the same PR.
|
Only the x86 build failed on a seemingly unrelated test:
|
I thought #10268 fixed this...
Looks like it passed on rerun or push so nevermind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks reasonable to me.
This SO answer would seem to backup the behaviour I'm seeing - apparently .NET objects don't get the cwd of the shell, so I'm not sure how/why it works for others. /cc @j4james |
As implemented in microsoft/terminal#10447
I don't know the first thing about PowerShell, so I wouldn't be hugely surprised to find out that there was something wrong with my patch, but the above change causes the script to fail for me. I'm running it via the |
Apparently it does...
I think this works because Switching to this seems to make it work in any directory, using $xamls = (git ls-files --full-name "$root/**/*.xaml")
foreach ($file in $xamls) {
$content = Get-Content "$root/$file"
[IO.File]::WriteAllLines("$root/$file", $content)
} |
@ianjoneill Yep. That works for me. |
Fixes the `Invoke-CodeFormat` and `Invoke-OpenConsoleTests` functions in `OpenConsole.psm1` so that they can be run directly from PowerShell. Addresses the issues found when creating #10447. `Invoke-CodeFormat` did not work when invoked directly from PowerShell due to a relative path being passed into the .NET function `[IO.File]::WriteAllLines()`. The working directory for .NET objects does not change when you change directory in PowerShell, so the paths were being treated as relative to the initial working directory of the shell - which was not the terminal git repo. `Invoke-OpenConsoleTests` had 3 issues: 1. The path to `TestHostApp` was wrong. 2. It would attempt to run the "in host app" tests both in the host app and not in the host app. 3. The test configuration in `tests.xml` wasn't in sync with the `runABC.cmd` files, so the remoting and control unit tests didn't run. ## Validation Steps Performed 1. Ran `Invoke-CodeFormat` and `runformat.cmd` from multiple directories and didn't see errors. 2. Ran `Invoke-OpenConsoleTests` and didn't see errors.
Gentle bump as this has been open a week with 1 out of 2 approvals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me personally. All comments are absolutely minor.
I'll leave this PR open for a bit in case someone more knowledgeable in these parts of the code has any objections. @msftbot please wait 1 more day before merging this |
Hello @carlos-zamora! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Thanks for the contribution, and sorry for the delay 😄 |
* command-line-arguments.md: Tag the Command Prompt code blocks For some reason they were tagged as bash, which broke highlighting in at least one of them. * fixed typo (#220) in line 98 it's `C:\\path\\to\\icon.png` while in line 115 it was `C:\\path\\to\\icon` so I've added the missing `.png` * Add note about escaping characters with backslash (#230) Originally filed by Andrewery https://github.com/MicrosoftDocs/terminal/pull/134/files * Add icon example and folder location (#231) From #135 * Add icon example and folder location As originally submitted by @aloneguid in #135 * Remove code brackets for readability * Add spacing * Fix default value by escaping characters (#232) Original submission: https://github.com/MicrosoftDocs/terminal/pull/134/files * Add info about the command palette (#180) * Add info about the command palette 1. Add info about the command palette. 2. Typo fixes (e.g. "quick-start guide" instead of "quickstart") 3. Style fix, e.g. we don't have a keyboard key whose full name is "alt+shift+plus". * revert description Co-authored-by: Matt Wojciakowski <[email protected]> * Add backslash escape note (#233) ...from PR #181 * Add a note about hiding dynamic profiles (#186) * Add a note about hiding dynamic profiles * Minor writing updates Co-authored-by: Matt Wojciakowski <[email protected]> * Clarify adding profile in ssh tutorial. Fixes #183 (#193) * Clarify adding profile in ssh tutorial. Fixes: #183 * Remove from docs link * Add guid command for powershell (#234) migrated from PR https://github.com/MicrosoftDocs/terminal/pull/199/files * Change "i.e." to "e.g." (#207) This seems to be the intended meaning: There are Linux distributions that are not Ubuntu, but Ubuntu is an example of a Linux distribution for which the behavior is the given. * Old Ubuntu: Use up-to-date version of golang (#216) Currently, the install recommends using an out-of-date version of golang, which in turn causes issues while installing powerline-go. * Add startingDirectory example (#237) * Add startingDirectory example * Format startingDirectory entry * remove icon file type Co-authored-by: Kayla Cinnamon <[email protected]> * Change icon description to example * Change false to true Co-authored-by: Kayla Cinnamon <[email protected]> * Remove unnecessary sentence Co-authored-by: Kayla Cinnamon <[email protected]> * Typo fixes Co-authored-by: Kayla Cinnamon <[email protected]> * link fix Co-authored-by: Kayla Cinnamon <[email protected]> * Capitalization fixes Co-authored-by: Kayla Cinnamon <[email protected]> * shortcut fixes Co-authored-by: Kayla Cinnamon <[email protected]> * page_title_updates_terminal (#243) * Add docs for `newWindow` action (#259) * refactor(powerline): update for oh-my-posh V3 (#263) * Improved title setting procedure on bash/Ubuntu so that it doesn't destroy `PS1` (#123) Improved title setting procedure on bash/Ubuntu so that it doesn't destroy `PS1` * Update powerline-setup.md (#240) * Update powerline-setup.md * Update powerline-setup.md * Update powerline-setup.md * fix typo * Merge release 1.7 into master (#264) Co-authored-by: Mike Griese <[email protected]> Co-authored-by: Don-Vito <[email protected]> * Update powerline-setup.md (#175) * Update powerline-setup.md Updated Tips to include setting the Integrated terminal within Visual Studio to use the Cascadia Code Powerlines font. Also added an additional resource which shows step by step how to do this * Combine VS Code & VS tips for setting up powerline * Remove external blog link Co-authored-by: Matt Wojciakowski <[email protected]> * Fix a monor typo with the default keybinding for new tab (#287) closes #270 * Add a note that --window is only available in 1.7+ (#288) * Add a note that --window is only available in 1.7+ closes #282 * Whoops, those can't go on one line * Fix a typo in this doc (#289) * Fix a typo in this doc Closes #280 * I bet the docs build is gonna complain about this one * Add a FAQ entry for folks who are confused when Settings does nothing (#290) * Add a note that you can't set the tab color from the commandline (#291) Closes #249 * Add UUID generator option * Add online guid generator * Add instructions to open defaults.json file * Update panes.md * Add note about using settings.json... ..not defaults.json for applying color schemes across profiles. * fix link * Merge release-1.8 into master (#309) Co-authored-by: Kayla Cinnamon <[email protected]> Co-authored-by: Don-Vito <[email protected]> Co-authored-by: Mike Griese <[email protected]> * Fix placement of unfocused appearance section (#312) * Update TerminalDocs/command-line-arguments.md * Update TerminalDocs/command-line-arguments.md * Add mouse interaction section (#297) Addresses issue #6 * document how to start windows terminal and have it execute a command (#298) * document how to start windows terminal and have it execute a command #296 * Separated the argument examples and included explanations of what they accomplish * fix typo * remove version from url Co-authored-by: Mark Iannucci <[email protected]> Co-authored-by: Matt Wojciakowski <[email protected]> * FIX syntax error in json configuration example (#308) FIX syntax error in json configuration example * Document trimBlockSelection setting (#313) * Document trimBlockSelection setting * Add preview disclaimer * Minor edit + note re how to select rectangular txt * Add preview to h2 Co-authored-by: Matt Wojciakowski <[email protected]> * Updated openSettings default bindings. (#317) * Updated openSettings default bindings. * Updated the openSettings description. * minor edits Co-authored-by: Matt Wojciakowski <[email protected]> * Update powerline-setup.md (#319) Fix a typo 'optonal' replaced by 'optional' * Updates for 1.9 release (#328) * Fix links * Typo "Windows terminal"→"Windows Terminal" (#326) https://docs.microsoft.com/en-us/windows/terminal/custom-terminal-gallery/custom-schemes #PingMSFTDocs * Add link to alternative install options (#321) Resolves #286 * Update `cursorHeight` minimum value (#278) Documentation update for microsoft/terminal#9386 * Add link to install preview (#342) * Add link to install preview * Update wording Co-authored-by: Kayla Cinnamon <[email protected]> * Update default settings, add UI screenshots (#343) * Update default settings, add UI screenshots * update screenshot * fix numbering * Fix screenshot steps * Correct title verbage, update screenshot * Add preview tags * Fix typos Co-authored-by: Kayla Cinnamon <[email protected]> * Add required version for OMP2 Oh-my-posh has updated to version 3, so adding a note to designate version 2 on this uninstall until we can return to this tutorial and update to version 3. In the meantime, there are other tutorials available on the web that walkthrough how to install OMP v3 and set it up with git status, etc. * Update quakemode monitor setting Based on #333 * Added link to Cascadia Code font * Add troubleshooting section on git bash flashing (#356) * font struct (#355) Co-authored-by: Pankaj Bhojwani <[email protected]> * documentation for minimzeToTray (#352) * Add documentation for closing tabs by index (#347) As implemented in microsoft/terminal#10447 * Update configuration section of get-start (#345) Select Settings in the dropdown menu will open the Settings UI instead of open file since the release version v1.6.10571.0 But this page is not up to date, so I edit it. * Add note about opening command palette via dropdown menu (#335) * Make link relative Co-authored-by: Samuel Bronson <[email protected]> Co-authored-by: LSC <[email protected]> Co-authored-by: skycommand <[email protected]> Co-authored-by: Mike Griese <[email protected]> Co-authored-by: Cameron Durham <[email protected]> Co-authored-by: Søren Fuglede Jørgensen <[email protected]> Co-authored-by: Janne Mareike Koschinski <[email protected]> Co-authored-by: Kayla Cinnamon <[email protected]> Co-authored-by: Meenal Patel <[email protected]> Co-authored-by: Jan De Dobbeleer <[email protected]> Co-authored-by: Dakkaron <[email protected]> Co-authored-by: Ibrahim Rouis <[email protected]> Co-authored-by: Don-Vito <[email protected]> Co-authored-by: Michael James <[email protected]> Co-authored-by: Mark Iannucci <[email protected]> Co-authored-by: Mark Iannucci <[email protected]> Co-authored-by: lpotherat <[email protected]> Co-authored-by: Sean Jacobs <[email protected]> Co-authored-by: superfaz <[email protected]> Co-authored-by: Hiroshi Yoshioka <[email protected]> Co-authored-by: Eugene Samoylov <[email protected]> Co-authored-by: PankajBhojwani <[email protected]> Co-authored-by: Pankaj Bhojwani <[email protected]> Co-authored-by: Leon Liang <[email protected]> Co-authored-by: Ian O'Neill <[email protected]> Co-authored-by: Gaein_nidb <[email protected]> Co-authored-by: Casper Verhaar <[email protected]>
🎉 Handy links: |
* command-line-arguments.md: Tag the Command Prompt code blocks For some reason they were tagged as bash, which broke highlighting in at least one of them. * fixed typo (#220) in line 98 it's `C:\\path\\to\\icon.png` while in line 115 it was `C:\\path\\to\\icon` so I've added the missing `.png` * Add note about escaping characters with backslash (#230) Originally filed by Andrewery https://github.com/MicrosoftDocs/terminal/pull/134/files * Add icon example and folder location (#231) From #135 * Add icon example and folder location As originally submitted by @aloneguid in #135 * Remove code brackets for readability * Add spacing * Fix default value by escaping characters (#232) Original submission: https://github.com/MicrosoftDocs/terminal/pull/134/files * Add info about the command palette (#180) * Add info about the command palette 1. Add info about the command palette. 2. Typo fixes (e.g. "quick-start guide" instead of "quickstart") 3. Style fix, e.g. we don't have a keyboard key whose full name is "alt+shift+plus". * revert description Co-authored-by: Matt Wojciakowski <[email protected]> * Add backslash escape note (#233) ...from PR #181 * Add a note about hiding dynamic profiles (#186) * Add a note about hiding dynamic profiles * Minor writing updates Co-authored-by: Matt Wojciakowski <[email protected]> * Clarify adding profile in ssh tutorial. Fixes #183 (#193) * Clarify adding profile in ssh tutorial. Fixes: #183 * Remove from docs link * Add guid command for powershell (#234) migrated from PR https://github.com/MicrosoftDocs/terminal/pull/199/files * Change "i.e." to "e.g." (#207) This seems to be the intended meaning: There are Linux distributions that are not Ubuntu, but Ubuntu is an example of a Linux distribution for which the behavior is the given. * Old Ubuntu: Use up-to-date version of golang (#216) Currently, the install recommends using an out-of-date version of golang, which in turn causes issues while installing powerline-go. * Add startingDirectory example (#237) * Add startingDirectory example * Format startingDirectory entry * remove icon file type Co-authored-by: Kayla Cinnamon <[email protected]> * Change icon description to example * Change false to true Co-authored-by: Kayla Cinnamon <[email protected]> * Remove unnecessary sentence Co-authored-by: Kayla Cinnamon <[email protected]> * Typo fixes Co-authored-by: Kayla Cinnamon <[email protected]> * link fix Co-authored-by: Kayla Cinnamon <[email protected]> * Capitalization fixes Co-authored-by: Kayla Cinnamon <[email protected]> * shortcut fixes Co-authored-by: Kayla Cinnamon <[email protected]> * page_title_updates_terminal (#243) * Add docs for `newWindow` action (#259) * refactor(powerline): update for oh-my-posh V3 (#263) * Improved title setting procedure on bash/Ubuntu so that it doesn't destroy `PS1` (#123) Improved title setting procedure on bash/Ubuntu so that it doesn't destroy `PS1` * Update powerline-setup.md (#240) * Update powerline-setup.md * Update powerline-setup.md * Update powerline-setup.md * fix typo * Merge release 1.7 into master (#264) Co-authored-by: Mike Griese <[email protected]> Co-authored-by: Don-Vito <[email protected]> * Update powerline-setup.md (#175) * Update powerline-setup.md Updated Tips to include setting the Integrated terminal within Visual Studio to use the Cascadia Code Powerlines font. Also added an additional resource which shows step by step how to do this * Combine VS Code & VS tips for setting up powerline * Remove external blog link Co-authored-by: Matt Wojciakowski <[email protected]> * Fix a monor typo with the default keybinding for new tab (#287) closes #270 * Add a note that --window is only available in 1.7+ (#288) * Add a note that --window is only available in 1.7+ closes #282 * Whoops, those can't go on one line * Fix a typo in this doc (#289) * Fix a typo in this doc Closes #280 * I bet the docs build is gonna complain about this one * Add a FAQ entry for folks who are confused when Settings does nothing (#290) * Add a note that you can't set the tab color from the commandline (#291) Closes #249 * Add UUID generator option * Add online guid generator * Add instructions to open defaults.json file * Update panes.md * Add note about using settings.json... ..not defaults.json for applying color schemes across profiles. * fix link * Merge release-1.8 into master (#309) Co-authored-by: Kayla Cinnamon <[email protected]> Co-authored-by: Don-Vito <[email protected]> Co-authored-by: Mike Griese <[email protected]> * Fix placement of unfocused appearance section (#312) * Update TerminalDocs/command-line-arguments.md * Update TerminalDocs/command-line-arguments.md * Add mouse interaction section (#297) Addresses issue #6 * document how to start windows terminal and have it execute a command (#298) * document how to start windows terminal and have it execute a command #296 * Separated the argument examples and included explanations of what they accomplish * fix typo * remove version from url Co-authored-by: Mark Iannucci <[email protected]> Co-authored-by: Matt Wojciakowski <[email protected]> * FIX syntax error in json configuration example (#308) FIX syntax error in json configuration example * Document trimBlockSelection setting (#313) * Document trimBlockSelection setting * Add preview disclaimer * Minor edit + note re how to select rectangular txt * Add preview to h2 Co-authored-by: Matt Wojciakowski <[email protected]> * Updated openSettings default bindings. (#317) * Updated openSettings default bindings. * Updated the openSettings description. * minor edits Co-authored-by: Matt Wojciakowski <[email protected]> * Update powerline-setup.md (#319) Fix a typo 'optonal' replaced by 'optional' * Updates for 1.9 release (#328) * Fix links * Typo "Windows terminal"→"Windows Terminal" (#326) https://docs.microsoft.com/en-us/windows/terminal/custom-terminal-gallery/custom-schemes #PingMSFTDocs * Add link to alternative install options (#321) Resolves #286 * Update `cursorHeight` minimum value (#278) Documentation update for microsoft/terminal#9386 * Add link to install preview (#342) * Add link to install preview * Update wording Co-authored-by: Kayla Cinnamon <[email protected]> * Update default settings, add UI screenshots (#343) * Update default settings, add UI screenshots * update screenshot * fix numbering * Fix screenshot steps * Correct title verbage, update screenshot * Add preview tags * Fix typos Co-authored-by: Kayla Cinnamon <[email protected]> * Add required version for OMP2 Oh-my-posh has updated to version 3, so adding a note to designate version 2 on this uninstall until we can return to this tutorial and update to version 3. In the meantime, there are other tutorials available on the web that walkthrough how to install OMP v3 and set it up with git status, etc. * Update quakemode monitor setting Based on #333 * Added link to Cascadia Code font * Add troubleshooting section on git bash flashing (#356) * font struct (#355) Co-authored-by: Pankaj Bhojwani <[email protected]> * documentation for minimzeToTray (#352) * Add documentation for closing tabs by index (#347) As implemented in microsoft/terminal#10447 * Update configuration section of get-start (#345) Select Settings in the dropdown menu will open the Settings UI instead of open file since the release version v1.6.10571.0 But this page is not up to date, so I edit it. * Add note about opening command palette via dropdown menu (#335) * Make link relative * Add updates for 1.10 release (#361) * Add reset settings to troubleshooting section Resolves #91 * Add 3rd party examples to dynamic profiles (#366) * Add experimental.input.forceVT setting to the interaction page (#367) * Add input.forceVT setting * Update wording * Replace screenshot with overview video * Add note about json vs UI settings for WSL starting directory Resolves #373 Co-authored-by: Samuel Bronson <[email protected]> Co-authored-by: LSC <[email protected]> Co-authored-by: skycommand <[email protected]> Co-authored-by: Mike Griese <[email protected]> Co-authored-by: Cameron Durham <[email protected]> Co-authored-by: Søren Fuglede Jørgensen <[email protected]> Co-authored-by: Janne Mareike Koschinski <[email protected]> Co-authored-by: Kayla Cinnamon <[email protected]> Co-authored-by: Meenal Patel <[email protected]> Co-authored-by: Jan De Dobbeleer <[email protected]> Co-authored-by: Dakkaron <[email protected]> Co-authored-by: Ibrahim Rouis <[email protected]> Co-authored-by: Don-Vito <[email protected]> Co-authored-by: Michael James <[email protected]> Co-authored-by: Mark Iannucci <[email protected]> Co-authored-by: Mark Iannucci <[email protected]> Co-authored-by: lpotherat <[email protected]> Co-authored-by: Sean Jacobs <[email protected]> Co-authored-by: superfaz <[email protected]> Co-authored-by: Hiroshi Yoshioka <[email protected]> Co-authored-by: Eugene Samoylov <[email protected]> Co-authored-by: PankajBhojwani <[email protected]> Co-authored-by: Pankaj Bhojwani <[email protected]> Co-authored-by: Leon Liang <[email protected]> Co-authored-by: Ian O'Neill <[email protected]> Co-authored-by: Gaein_nidb <[email protected]> Co-authored-by: Casper Verhaar <[email protected]>
Summary of the Pull Request
Updates the
closeTab
action to optionally take an index.PR Checklist
closeTab
should accept anindex
param #7180Validation Steps Performed
Added the following configuration to
settings.json
and validated both key combinations behaved as expected. Also opened the command palette and ensured that the actions were displayed.