TShock icon indicating copy to clipboard operation
TShock copied to clipboard

Console feels awkward

Open patsore opened this issue 4 years ago • 8 comments

Hello! There is an issue with the console that I haven't found addressed in issues, at least from what I've looked through. There are often weird line displacement issues, which make writing and editing commands very awkward. Sometimes I'd try to delete some text, but visually it'd stay there, sometimes the debug log displaces the line I was typing in, and hiding part of what I'd typed from me. I tried looking into it, but it doesn't look like an issue coming from my terminal/OS.

patsore avatar Jun 18 '21 18:06 patsore

I believe this issue happens when something is written to the console while you're in the middle of typing, overwriting the visibility of your input text.

Terrabade avatar Jun 18 '21 21:06 Terrabade

sometimes the debug log displaces the line I was typing in, and hiding part of what I'd typed from me.

That's what I meant by this But still, not only this problem exists. For example, after I send a command, the colon sometimes doesn't restore to the beginning of the line, I start typing - do a typo, and when I try deleting it, with backspace, it just stays there, I press backspace ten times for the two letters that might be left, type out the command back from the beginning, just to get an 'Invalid command entered. Type /help for a list of valid commands.' message.

patsore avatar Jun 18 '21 21:06 patsore

@patsore it's definitely awkward, but it's something that is more or less going to be a function of Terraria server. @bartico6 had some thoughts about this privately. We all agree that it's not-ideal for the console to more or less be "as effective as building a house next to a boat in a river" but nobody has really dug into it. Most of what we've built optimizes for interacting in-game instead of having to deal with the awful console.

hakusaro avatar Jun 19 '21 08:06 hakusaro

Yeah, which bloody part, console "awkward" tells us nothing about it.

ok. First, the backspace visual glitch. image As you can see here, there is a phantom 'h' that, for some reason, decided to show itself without actually doing anything

Or another example - the disappearance of the colon: Screenshot from 2021-06-19 00-34-07

Another issue - two absolutely identical commands - one works, one doesn't - without any clue as to why image

patsore avatar Jun 19 '21 08:06 patsore

While setting some things, encountered another issue with the phantom letters image

patsore avatar Jun 19 '21 08:06 patsore

@patsore it's definitely awkward, but it's something that is more or less going to be a function of Terraria server. @bartico6 had some thoughts about this privately. We all agree that it's not-ideal for the console to more or less be "as effective as building a house next to a boat in a river" but nobody has really dug into it. Most of what we've built optimizes for interacting in-game instead of having to deal with the awful console.

Oh, didn't notice your reply earlier. Ok, fair point.

patsore avatar Jun 19 '21 08:06 patsore

I think this is "a widespread console issue" moreso than "terraria/tshock console issue"

If your project uses Console.ReadLine() and Console.WriteLine() you are going to be subject to this - the console is a stream of letters which you can write to with keyboard and program simultaneously without any buffers dedicated to each - overruns like this are BOUND to happen.

Every seasoned user of such an app kinda has this muscle memory of "I made a typo three letters from here, I hit backspace three times and carefully retype what I screwed up" but this cannot be expected of people who use a visual feedback loop for typo correction (aka track the cursor while backspacing to the error they made)

In reality this is a problem with the following tradeoffs:

  • If you want to fix this, you must take over all console controls and manually reprint everything to be in the right place including the cursor. You'd also have to ditch .ReadLine() and .WriteLine() and instead listen to single-key inputs and print out what that represents synchronised to the rest of the console.
  • Fixing this means you also have to retain control over the way the console info is formatted - which by itself might mean having to store the entire console buffer (potentially multiple screens long) in memory to rewrite whenever an important change happens
  • Every large-scale console rewrite will cause it to flicker.
  • If you don't fix it, you're doomed to deal with your inputs sometimes mixing with server outputs.

There definitely must be a way to solve this (I'm thinking how certain linux apps handle input having its own buffer zone at the bottom of the screen while output appears above that zone instead) but it's not a solution I've procured yet.

bartico6 avatar Jun 19 '21 17:06 bartico6