Skip to content
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

Add an exportBuffer action #12097

Merged
4 commits merged into from
Jan 12, 2022
Merged

Add an exportBuffer action #12097

4 commits merged into from
Jan 12, 2022

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Jan 5, 2022

This adds an action for the context menu entry we added in #11062. That PR added support for exporting the buffer, exclusively through the tab item's context menu. This adds an action that can additionally be bound, which also can export the buffer to a file. This action accepts a path param. If empty/ommitted, then the Terminal will prompt for the file to export the buffer to.

@zadjii-msft zadjii-msft added Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Jan 5, 2022
Copy link
Member

@carlos-zamora carlos-zamora left a 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! Thanks!

@carlos-zamora
Copy link
Member

oh, the docs. Update them plz haha

@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Jan 7, 2022
zadjii-msft added a commit to MicrosoftDocs/terminal that referenced this pull request Jan 7, 2022
  From microsoft/terminal#12097

  ## Buffer Exporting

  ### Export Buffer

  This allows the user to export the text of the buffer to a file. If the file doesn't exist, it will be created. If the file already exists, its contents will be replaced with the Terminal buffer text.

  **Command name:** `exportBuffer`

  **Default bindings:**

  ```json
  { "command": { "action": "exportBuffer" } },
  ```

  #### Actions

  | Name | Necessity | Accepts | Description |
  | ---- | --------- | ------- | ----------- |
  | `path` | Optional | String | If provided, then the Terminal will export the buffer contents to the given file. Otherwise, the Terminal will open a file picker to choose the file to export to. |

  > [!IMPORTANT]
  > This feature is only available in [Windows Terminal Preview](https://aka.ms/terminal-preview).
Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man it's become a lot easier to do things around here with X macros hasn't it?

}
else
{
// The file picker isn't going to give us paths with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly wouldn't hurt you to call this on either path just in case, but it's fine.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 12, 2022
@ghost
Copy link

ghost commented Jan 12, 2022

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 862d8ed into main Jan 12, 2022
@ghost ghost deleted the dev/migrie/f/9700-exportBufferAction branch January 12, 2022 16:58
@ghost
Copy link

ghost commented Feb 3, 2022

🎉Windows Terminal Preview v1.13.10336.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants