Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions PowerSession.Main/Commands/RecordCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using ConPTY;
using Newtonsoft.Json;
Expand Down Expand Up @@ -67,7 +68,7 @@ private void _record(string filename, string command = null)
{
if (string.IsNullOrEmpty(command)) command = "powershell.exe";

if (_env == null) _env = Environment.GetEnvironmentVariables();
if (_env == null) _env = new Dictionary<string, string>();
_env.Add("POWERSESSION_RECORDING", "1");
_env.Add("SHELL", "powershell.exe");
_env.Add("TERM", Environment.GetEnvironmentVariable("TERMINAL_EMULATOR") ?? "NotSure");
Expand All @@ -81,7 +82,7 @@ private void _record(string filename, string command = null)
Environment = _env
};
writer.SetHeader(headerInfo);

var terminal = new Terminal(writer.GetInputStream(), writer.GetWriteStream(), width: headerInfo.Width, height: headerInfo.Height);
terminal.Record(command, _env);
Console.WriteLine("Record Finished");
Expand Down