Coder Social home page Coder Social logo

powersession's People

Contributors

ariasemis avatar craigminihan avatar dependabot[bot] avatar ibigbug avatar sitiom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

powersession's Issues

Recording pwsh.exe

๐Ÿ‘ This is awesome, love your work. ๐Ÿ‘

Is there a way to change the command it runs? For example, to run pwsh.exe rather than powershell?

Edit: FWIW, I tried this and it worked perfectly.

var record = new Command("rec")
{
    new Argument<FileInfo>("file"),
    new Argument<string>("command", "powershell.exe")
    {
        Arity = ArgumentArity.ExactlyOne
    }
};
record.Handler = CommandHandler.Create((FileInfo file, string command) =>
{
    var recordCmd = new RecordCommand(new RecordArgs
    {
        Filename = file.FullName,
        Command = command
    });

    recordCmd.Execute();
});

Recorder should not capture all environment vars

Thank you for making this, it's really awesome!

I noticed that the output file lists all my env variables, which is not ideal when sharing it.

According to the spec from asciicinema:

Official asciinema recorder captures only SHELL and TERM by default. All implementations of asciicast-compatible terminal recorder should not capture any additional environment variables unless explicitly permitted by the user.

Do you think this could be fixed?

Thank you again!!

Small script to automate recordings

Hi I wrote a small powershell script to automate recordings.
Feel free to use it!

function Parse-KeyText ($Content) {
	$Content = $Content.Replace("`r`n", "`n").Replace("`n", "{ENTER}")
	[regex]$regex = '(?<modifiers>[+^%]+)?(?<content>{[^}]+}|[^+?^\^^%])'
	$regex.Matches($Content) | % { $_.Value }
}

function Send-Keys ($KeyStrokes, $KeyPressSleep = 30, $LongSleep = 1500) {
    $wshell = New-Object -ComObject wscript.shell;
	foreach ($KeyPress in $KeyStrokes)
	{
		if ($KeyPress -eq '{SLEEP}')
		{
			Sleep -Milliseconds $LongSleep
		}
		else {
			Sleep -Milliseconds $KeyPressSleep
			$wshell.SendKeys($KeyPress)
		}
	}
}
#Documentation https://ss64.com/vb/sendkeys.html
$textToSend = @"
+^t{SLEEP}cd D:\Users\Peter\source\repos\FluentTerminal
powersession rec -c "pwsh -nologo" recording.txt
{SLEEP}Import-Module PowerType
{SLEEP}Enable-PowerType
git c{SLEEP}{DOWN}{SLEEP}{DOWN}{SLEEP} m{SLEEP}{DOWN}{SLEEP}
exit
{SLEEP}exit

"@
Write-Host "Installing powertype"
Install-Module PowerType
Write-Host "Simulating"
$KeyStrokes = Parse-KeyText -Content $textToSend
Send-Keys -KeyStrokes $KeyStrokes
Write-Host "Uninstalling PowerType"
Uninstall-Module PowerType

example of the result:
asciicast

Update help text

Firstly thanks for creating this! Works like a charm!

I see that PowerSession now supports cmd and pwsh through the --command parameter(#4), but this option is not shown in the help text. It would make its discovery easier.

Also, on a side note, when I do powersession play hello2.txt and the file hello2.txt doesn't exist, PowerSession just dumps out a stacktrace. It'd be better if it just said 'File not found'.

Cheers!

winget support?

Hi thanks for a great program, are there any plans to publish on winget?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.