terminal
                                
                                 terminal copied to clipboard
                                
                                    terminal copied to clipboard
                            
                            
                            
                        Pasting a multiline block of text does not `autoMarkPrompts`
- Turn on "experimental.autoMarkPrompts": true,and"experimental.rightClickContextMenu": true,
- turn on shell integration too. Just in general always, it's goodness.
- Copy the following
command-one
dir
command-two
command-three
- Paste it. Accept the warning.
- Try to right-click "select output" or command.
- Observe that it no worky.
Surely, when we paste text, we're not going through the same path in Terminal.cpp that marks enter
Note: don't do this for
- the alt buffer
- bracketed paste
Similarly, this doesn't work if you sendInput(foo\rbar\nbaz). None of them seem to work to mark.
I'm guessing it's because sendInput comes in through the paste handler. Might be able to fix
I am somewhat anti-this. Most multi-line pastes are into things that aren't shells probably...
The alt buffer doesn't have marks at all, so there's that to mitigate some concerns.
FWIW I even tried doing sendInput with \u001b[13;28;13;1;32;1_\u001b[13;28;13;0;32;1_ (enter) and even that didn't mark the commands ended.
(I may be able to fake this better with powershell)
Okay, well, this actually will just never work (for probably obvious reasons). I'm focusing narrowly on the sendInput scenario here, but it's equally obvious for paste.
When we call ControlCore::SendInput, we write the text directly to the connection. We could split that on each \r, and then try to automark on each of those newlines, BUT: we don't know when the output of each of those will be. We'd write a block, mark the line, write a block, mark, etc, probably multiple times before we got the first bit back out of the first command. When we get that block, nothing will actually get emitted before we write the whole block.
uhg.
Goddard, options:
- COOKED_READ emits a 133;C when it processes an enter
- dangerous, certainly too dangerous for Build)
 
- add some sort of commandsparam to sendInput, and that will wait to the next prompt between sending elements in the commands array- deeply underspec'd
 
- definitely just cut this from the demo? Or at least blow past the fact that the command also gets selected
- add a sleepaction that literally justSleeps for that timeout, so that I can thenmultipleActions([sendInput, sleep, ])ah fuck see that still doesn't work. Still doesn't mark the command
- Maybe see if I can bodge PWSH into supporting 133;C without automarking
You know what, in light of how painful some of the proposed fixes are, and how specifically automarkPrompts==="mark when you press enter", then I'm gonna close this out as "by design". Kinda unexpected, and I could be convinced the other way, but only if there was a good solution proposed.