-
This also happens in WT. Here it is in a console. Below, there are two wrapped instances of "abcdefgh", the first one part of a TCC command line and the second, part of TCC output. I copied the first wrapped instance of "abcdefgh" (left_mark, right_click) and then I did the same with the second instance. And then I had a look at the top two items in the clipboard history. In the first case "abcdefgh" was copied with a newline in the middle; in the second case it was copied without a newline. [Pasting somewhere after each copy shows the same difference.] How can that happen? ... text that was command line input copying differently from text that was output? It has something to do with TCC because if I create the text with another shell, both copies are without newlines. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
So, this usually happens when the shell implements its own wrapping for the input line. This behavior exists in Effectively, from the terminal emulator's perspective it's receiving Output is, of course, not given the same treatment... at least not by most of the |
Beta Was this translation helpful? Give feedback.
-
Yep, TCC does it's own command line editing. But I don't quite understand. By the time I do the copy experiment both commands and their output are history. Aren't the two versions of the wrapped string identical in the console screen buffer? |
Beta Was this translation helpful? Give feedback.
So, this usually happens when the shell implements its own wrapping for the input line.
This behavior exists in
bash
, for example. It knows the width of the screen and the width of the prompt, so it just inserts aCR
andLF
explicitly at the edge of the screen while rendering your input.Effectively, from the terminal emulator's perspective it's receiving
e
c
h
o
SP
SP
...SP
SP
a
b
c
d
CR
LF
e
f
g
h
Output is, of course, not given the same treatment... at least not by most of the
echo
primitives I've seen.