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 exportBuffer action (1.13) #479

Merged
merged 1 commit into from
Jan 24, 2022
Merged

Conversation

zadjii-msft
Copy link
Contributor

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:

{ "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.

  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).
@opbld31
Copy link

opbld31 commented Jan 7, 2022

Docs Build status updates of commit 2bc14a4:

✅ Validation status: passed

File Status Preview URL Details
TerminalDocs/customize-settings/actions.md ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

ghost pushed a commit to microsoft/terminal that referenced this pull request Jan 12, 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. 

* Does a part of #9700
* Spec in #11090, but I doubt this is contentious
* [x] This will satisfy #12052
* [x] I work here
* [x] docs added: MicrosoftDocs/terminal#479
@cinnamon-msft cinnamon-msft changed the base branch from main to release-1.13 January 20, 2022 23:09
@opbld32
Copy link

opbld32 commented Jan 20, 2022

Docs Build status updates of commit 2bc14a4:

✅ Validation status: passed

File Status Preview URL Details
TerminalDocs/customize-settings/actions.md ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@cinnamon-msft cinnamon-msft merged commit de9fedd into release-1.13 Jan 24, 2022
@cinnamon-msft cinnamon-msft deleted the dev/migrie/exportBuffer branch January 24, 2022 18:27
@fischerdouglas
Copy link

Export console buffer automatically.

I'm not a programmer, but considering this is now a macro, in theory you could create something like:
-> On close the TAB (or the entire WT), run this macro to export the console buffer.

I imagine this would need to be defined in the profiles that opened each TAB.
Also, as the path and filename are required, this could be set from environment variables like:

  • TAB name
  • Date and time (including seconds and milliseconds to avoid file duplications)
  • Maybe even a sequential number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants