CodeblockCustomizer icon indicating copy to clipboard operation
CodeblockCustomizer copied to clipboard

Raw CLI Output

Open Crims-on opened this issue 4 months ago • 6 comments

Would be nice if I could copy from a terminal and get highlighting directly, would that be possible? What I mean is like the prompt highlighting but doing that to the content and not putting a prefix

Crims-on avatar Sep 08 '25 21:09 Crims-on

I didn't think of this, but I am not sure if this would be that easy. I agree with you, it would be much simpler, but this raises a lot more complex problems/questions. How to parse the text? I mean, I would have no clue to know what you just paster? What type of prompt it is. But let's say you have a parameters like parse:kali to define what kind of text it is you pasted. There are so many different type of prompts. The only possible way I see, is that you had to define the regex yourself, for every type of prompt you use. For example you use most Powershell, and bash prompts. Then you had to define a regex which matches them. But if you paste a text, which is somehow a little different, then it wouldn't work. This feature need to reliably parse the text, and handle a lot of different variations.

I leave this open, so I can think about this, when I have time. I will look into this, but I am not promising anything yet. I will definitely come back and let you know, what I found out.

mugiwara85 avatar Sep 08 '25 21:09 mugiwara85

Yeah you're very right about that, but you have a some preconfigured parsing, so if you check against that format then you get a few options at least. The problem will be when users are customizing their shells for themselves, but default prompts would be nice even though everything won't be highlighted

Crims-on avatar Sep 08 '25 22:09 Crims-on

I agree. But, as I said, let me think about, how to implement it, and I'll get back to you :)

mugiwara85 avatar Sep 08 '25 22:09 mugiwara85

@Crims-on I think you'll have soon something for testing ;)

Image

mugiwara85 avatar Sep 19 '25 00:09 mugiwara85

@Crims-on You can test it now. Just take the main.js and styles.css and overwrite your with them (of course create a backup before). After that just create a codeblock and paste some raw CLI output in it. You can define parse:<promptid> to parse it as that specific prompt. PromptId is the same as until now so bash, kali, zsh, zshgit, msf, etc. or the id if you created one (altough in this case your regex might need some change). Please test as soon as you can, as I am preparing for a next release. Feedback would be very much appriciated!

mugiwara85 avatar Sep 20 '25 02:09 mugiwara85

Looks like it is working great, nice job!

Image

Crims-on avatar Sep 20 '25 10:09 Crims-on