sindresorhus / ansi-escapes

ANSI escape codes for manipulating the terminal
MIT License
482 stars 44 forks source link

Add ConEmu-specific escape codes #7

Open DRSDavidSoft opened 5 years ago

DRSDavidSoft commented 5 years ago

ConEmu

I'd like to add some of the ConEmu-specific escape codes via a PR if it's okay with you.

documentation:
https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC

For example, the equivalent to this iTerm 2 sequence: https://github.com/sindresorhus/ansi-escapes/blob/5f93ecafddfc02f562d41d776c96938fc27ce333/index.js#L129

Would be this for ConEmu:

x.ConEmu.setCwd = (cwd = process.cwd()) => `${OSC}9;9;${cwd}${BEL}`; 

per the documentation:

Sequence Description
ESC ] 9 ; 9 ; “cwd” ST Inform ConEmu about shell current working directory.
sindresorhus commented 5 years ago

Sure, PR welcome :)

sindresorhus commented 5 years ago

We could then also add a general setCwd method which uses iTerm.setCwd on iTerm and ConEmu.setCwd on ConEmu.