- Feb
- 240
- 3
I often need to copy the current directory to the clipboard, for later use in composing TCC commands. I attempted to create an alias for this operation, but I have not yet found the right approach. I tried the following:
echo %_cwds > clip:
However, this has two problems:
1] It includes a CR/LF at the end, so if I paste it on the command line, the command line executes immediately, without giving me a chance to edit it as necessary.
2] Because I have "UnicodeOutput" enabled, the resulting clipboard data includes a BOM at the beginning (FF FE). This prevents TCC from properly pasting the data back into the command line - when I click "paste" on the command line, I get a question mark at the beginning of the path. (Is this WAD? I note that I can successfully paste the same clipboard data into Notepad, or MS Word, or into the unicode editor EditPadPro, and these programs all ignore the BOM and paste only the text; wouldn't it make sense for TCC to also ignore any BOM at the beginning of the clipboard when pasting text?)
In any case, my question remains: how can I copy the value of %_cwds directly to the clipboard, without the leading BOM, and without the CR/LF at the end?
Alternatively, is there any way from within TCC to slightly modify the clipboard after the "echo" command, in order to remove removing the inital two bytes and the final four bytes?
echo %_cwds > clip:
However, this has two problems:
1] It includes a CR/LF at the end, so if I paste it on the command line, the command line executes immediately, without giving me a chance to edit it as necessary.
2] Because I have "UnicodeOutput" enabled, the resulting clipboard data includes a BOM at the beginning (FF FE). This prevents TCC from properly pasting the data back into the command line - when I click "paste" on the command line, I get a question mark at the beginning of the path. (Is this WAD? I note that I can successfully paste the same clipboard data into Notepad, or MS Word, or into the unicode editor EditPadPro, and these programs all ignore the BOM and paste only the text; wouldn't it make sense for TCC to also ignore any BOM at the beginning of the clipboard when pasting text?)
In any case, my question remains: how can I copy the value of %_cwds directly to the clipboard, without the leading BOM, and without the CR/LF at the end?
Alternatively, is there any way from within TCC to slightly modify the clipboard after the "echo" command, in order to remove removing the inital two bytes and the final four bytes?