Skip to content

Terminal watcher - bucket and event design #207

@Otto-AA

Description

@Otto-AA

I've been working on a terminal watcher in the last days and need some inspiration on the bucket and event design. (you can view the WIP repo here)

The reason why I made a terminal watcher was mainly, because VS Code has an integrated terminal, but doesn't seem to provide any API for tracking activity in it. Hence, tracking via the aw-watcher-vscode extension as well as using the aw-watcher-window data both won't work and I have a rather significant loss of activity data (I guess about 1/3 of VS Code time).


The current implementation of the terminal tracker sends an event to the server every time a command is being executed in a (bash) terminal. This way following data could be tracked:

  • command + args
  • path of the terminal
  • execution time of command
  • any environment variable
  • anything else you can get with bash
  • (with different implementation) outputs of the command

Using this data, I can think of a few ways to use them:

  1. Track my personal interaction with the terminal
  2. Track the frequency and duration of commands I've used (in particular backup and compiling commands would interest me)

While for the first use case, working with heartbeats seem the better solution, the second one would seems suited for events. That's why I would consider splitting these two into separate buckets.


Independent from that, I think it could be useful to create a general terminal watcher with several platform specific watchers attached to it. So for example aw-watcher-terminal-bash only writes some things to a named pipe and aw-watcher-terminal forwards this to the server. But this could be changed later and is not necessary to discuss now from my point of view.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions