Watfaq / PowerSession-rs

Rust implementation of PowerSession, with new features and enhancements
https://github.com/Watfaq/PowerSession-rs
MIT License
170 stars 7 forks source link

PowerSession does not work properly #44

Open axdank opened 2 years ago

axdank commented 2 years ago

Hello, I think this program is very necessary but in my case I found multiple problems.

  1. I have run PowerSession with the shell (Nushell), when I give exit, the console crashes leaving it unusable (When using pwsh the console does not crash).

terminal-broken-1

  1. I think the main use of this is not only for recording command executions, but also programs or text editors like helix or neovim. When running helix, there is a panic in the program (record.rs:134:72), String::from_utf8 section (I have tried with neovim and the same thing happens), rarely in the buffer invalid utf8 sequences are received (but when running normally these programs, the terminal has no complaints, also helix is written in rust, and everything is supposed to be utf8 ).

terminal-broken-2

  1. I changed from String::from_utf8 to String::from_utf8_lossy, to try to run helix again.

imagen

  1. When running, it works, but the program is completely distorted, which makes it unusable.

terminal-broken-3

  1. Same procedures with pwsh, the only thing is that when you exit powersession, the terminal still works fine and does not break.

terminal-broken-4

Os: Windows 11 Terminal Emulator: Windows Terminal Shell: Nushell Rust version: 1.62.1

ibigbug commented 2 years ago

the utf8 issue should get fixed in this https://github.com/Watfaq/PowerSession-rs/pull/49/files

while the messed up output seems to be something related to console mode https://docs.microsoft.com/en-us/windows/console/setconsolemode

trying to figure it out

sitiom commented 2 years ago

@ibigbug Were you supposed to publish 0.1.7 but it failed (https://github.com/Watfaq/PowerSession-rs/commit/66e883069e76ffd59ae8adadb53aab85d2e7941e)?