-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add an exportBuffer
action
#12097
Conversation
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! Thanks!
oh, the docs. Update them plz haha |
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).
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.
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 |
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.
Honestly wouldn't hurt you to call this on either path just in case, but it's fine.
Hello @zadjii-msft! 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 (
|
🎉 Handy links: |
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.exportBuffer
action (1.13) MicrosoftDocs/terminal#479