-
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
megathread: Buffer exporting and logging #9700
Comments
Just like in #9760, we can't actually use the UWP file picker API, because it will absolutely not work at all when the Terminal is running elevated. That would prevent the picker from appearing at all. So instead, we'll just use the shell32 one manually. This also gets rid of the confirmation dialog, since the team felt we didn't really need that. We could maybe replace it with a Toast (#8592), but _meh_ * [x] closes #11356 * [x] closes #11358 * This is a lot like #9760 * introduced in #11062 * megathread: #9700
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
Can anyone teach me how to configure it? Why is the log file not automatically generated after I configured it? Are you modifying setting.json?Thank you all. My version is v1.17.11461.0 |
Because this feature isn't actually implemented yet. What's in the OP was my spec-in-progress, which got turned into the draft spec over at #11090 |
will this feature be added next release version? |
@yuahualove Which feature? This megathread is tracking both exporting and auto-logging.
|
Buffer exporting is not enough because I have a login procedure going in error but not able to see all error messages because it cleare the terminal. |
[Original thread: #642] [Spec: #11090 {in progress}] [#11062]
This thread is being used to track all the component work for buffer logging and exporting.
2.0 Bugs
Buffer exporting
This is the easier work to do. #11062 already wires up the TerminalApp to retrieve the buffer contents from the
TermControl
, so writing them at request is easy.exportBuffer()
action that opens the file pickerpath
parameter toexportBuffer()
that allows the user to press a key and immediately export the buffer to a whole path""
, which indicates "open the file picker"append
(default tofalse
) parameter toexportBuffer
. When true, export to the file given by appending, not overwriting the filepath
parameter.yyyy-mm-dd
?%Y-%m-%D
?&Y-&m-&D
?{year}-{month}-{day}
?WT_SESSION
, for a uuid for eash session maybe?Automatic logging
This is harder. We don't want the
TermControl
telling theTerminalApp
layer about every piece of output logged. That would be insane, especially in the post-#5000 world where that's a cross-process hop. Instead, we'll want theControlCore
/ControlInteractivity
to do logging themselves. I suppose that this should have been tracked in #3044 separately from #642, but here we are.toggleLogging()
Action for start/stop logging, withpath
,append
properties (likeexportBuffer()
)ToggleLoggingArgs
contains a single memberLoggingSettings
, which containspath
andappend
properties. This will make sense below.LoggingSettings
property for "log all output" (default would just be "log printable output")LoggingSettings
property for "log input" (Though, we'd probably want to log it as normal VT encoded, not aswin32-input
encoded)LoggingSettings
property for "New file every day", which only works when the{day}
is in the path string. When auto-logging with this setting, opens a new file at midnight and starts writing that one.LoggingSettings
property for "Flush log frequently", defaults totrue
(?). This causes us to flush all output to the file, instead of just... on close? on newline? It's unclear exactly when PuTTY flushes with this off. Need more coffee.Initially I thought it might be nice to have
LoggingSettings
be the same forexportBuffer()
andprofile.logging
. ButnewFileEveryDay
andflushFrequently
don't make sense forexportBuffer()
. Though I guess they do make sense fortoggleLogging()
Reference
PuTTY logging settings
See also: https://tartarus.org/~simon/putty-snapshots/htmldoc/Chapter4.html#config-logfilename
SecureCRT logging settings
The text was updated successfully, but these errors were encountered: