Most of this was a straightforward replacement of our code with theirs
but I also removed `getDefaultShellAndArgs` since it seems the reference
implementation no longer does that either.
Fixes#2276.
- Instead of a single listener per terminal that handles all events VS
Code now has a single listener per event that handles that event for
all terminals.
- Refactor Terminal to extend TerminalProcess to avoid duplicating
methods. This required some modifications to TerminalProcess to access
the pid and title and to set the ID.
- Remove our async change to shutdown. This was necessary to avoid
disposing too early but shutdown already calls dispose so it turns out
we didn't need to call it ourselves.
- Rename methods to match the command strings.
- Fix getting system shell (uses process.env).
- Use a single bufferer. Since it already supports buffering for
multiple terminals there's no need to have one per terminal.
- Remove replay/reconnect logic. It's broken and unused so there doesn't
seem much point in trying to refactor it to fit the changes right now.
While terminals work now there are still a lot of todos.