vamolessa / pepper

simple and opinionated modal code editor for your terminal
https://vamolessa.github.io/pepper/
373 stars 15 forks source link

Cross-talk between UI clients #5

Closed leahneukirchen closed 2 years ago

leahneukirchen commented 3 years ago

Open one pepper and activate the command mode :foo, don't press return yet.

Open another pepper, it takes over the prompt now.

vamolessa commented 3 years ago

Yeah, it's like that because clients are dumb: they only send keys to server and receive back what to render. So when another clients comes in, the prompt state is not lost since it's on the server.

leahneukirchen commented 3 years ago

But if two clients are connected, shouldn't they have their own prompt states? (It does not need to be stored locally.)

vamolessa commented 3 years ago

That makes sense. However I'm not sure it's an easy change as prompts are tied to the mode the editor is in. So each client having it's own prompt would mean each client having it's own mode. And we'd have to check the implications of it.

vamolessa commented 3 years ago

ops, sorry I closed accidentally

vamolessa commented 2 years ago

Ok, so this does not happen any more. However, it's still not the "each client has its own prompt". If a client starts typing, then another one is focused, the editor goes to normal mode and the prompt is canceled. This is less weird than used to be.

However, I'm leaning towards treating each client remember its own prompt as out of scope. Unless there's some real use case that I'm failing to see.

So I'll close this for now. But feel free to reopen if there's more to discuss!