Don't Starve Together

Don't Starve Together

Console++ [client version]
57 Comments
FriendlyGrass  [author] 19 Jan @ 7:52pm 
Finally, here are a few of the Windows-specific bugs and issues in the vanilla game's text input engine that I've found. In the future, I hope to alleviate the issues they cause using this mod.

1. Pressing many key combinations inserts garbage characters into the console input.
2. Entering a new line will sometimes input the characters "\r\n" (correct) or sometimes "\n\r" (incorrect). In the latter case, the text input appears as though two new lines have been created. Also, in either case, it may take two backspace presses to delete the newline, rather than one.
3. Modifier keys can get stuck, as if pressed, if they are pressed down at the moment the game window loses focus.
FriendlyGrass  [author] 19 Jan @ 7:52pm 
Hi, the issue with carriage returns being entered on Windows when running a command is fixed. However, it's possible this hasn't fixed the issue you're describing, even though I couldn't reproduce it again. The game's text input system can be finicky, but let me know if you are still experiencing issues. Also, remember, you can use Ctrl+Enter to "force-run" the command in the console (as opposed to Shift+Enter to create a new line).
FriendlyGrass  [author] 19 Jan @ 6:10am 
Sorry about the delay!! I will test on a Windows machine later today, which seems to be the source of these issues.
Aire Ayquaza 12 Jan @ 4:12am 
Hi! I have same issues as mentionned by @󰀏Niko
󰀏Niko 11 Jan @ 3:09pm 
The mod is still basically unusable. Half the time it wont let me send commands, doing line breaks instead. It only started happening after the latest update. Please fix, this mod use to be a must have for me.
󰀏Niko 5 Jan @ 12:49pm 
The mod seems to crash if sending a console command if you are not the host of the server.
FriendlyGrass  [author] 28 Dec, 2024 @ 8:09am 
On a side note, has anyone tried out the pseudoclipboard feature? Do you think it is a useful feature to have?
FriendlyGrass  [author] 28 Dec, 2024 @ 7:50am 
Ah, damn. In hindsight it definitely was a bit dirty of me to add the mods directory to assetpath to be able to put console_clipboard.lua, it's just that I thought it would be a much more convenient location. Perhaps I'll move it again to the data directory as you suggest.
WINWIN 28 Dec, 2024 @ 7:21am 
i found that pseudoclipboard is incompatible with Smart Minisign (https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1595631294) . This might be a side effect of adding "../mods/" to packages.assetpath in pseudoclipboard.lua. I recommend not saving the console_clipboard.lua file in the mods directory but instead in the data directory, as I recall that this directory allows file writing with io.open.
FriendlyGrass  [author] 27 Dec, 2024 @ 2:50pm 
Hi Niko, sorry I haven't been able to reproduce the issue, but I still have yet to test v1.5.0 on Windows, or MacOS for that matter, and I suspect this may be the issue. Which operating system are you on?
󰀏Niko 24 Dec, 2024 @ 3:16pm 
After the latest update it seems that pressing enter will input a line break before running the command. This ruins the command if done while the cursor is in the middle of the command.
GeneralAndo 1 Aug, 2024 @ 7:07am 
good mod but there is still a error with unicode symbols showing when you paste a big function
∮❆Elternus❆∮ 26 Jun, 2024 @ 4:01am 
what component change name or description of item?
󰀏Niko 31 Mar, 2024 @ 6:26pm 
I've been getting engine crashes when trying to open the console while working with strings that are too large for the font renderer to handle, could you make the console clip such strings to a size that wont crash the game? I don't even think strings larger than the screen size can be seen past the screen anyway.
Cliffford W 3 Mar, 2024 @ 8:16am 
This seems to not be friendly with QWERTZ
Attempted to do a [ using Ctrl + Alt + F and { using Ctrl + Alt + B
It does not work
RICK 20 Feb, 2024 @ 9:57am 
specifically consolemodder:196
RICK 20 Feb, 2024 @ 9:56am 
v.1.4.9 is still broken with TheWorld being nil outside game.
FriendlyGrass  [author] 14 Feb, 2024 @ 7:40pm 
Oh no! Sorry things are still broken for you :(
I can't reproduce the crash, but I added the guards that should hopefully be enough resolve any problems.
󰀜瑶光󰀜 13 Feb, 2024 @ 12:13am 
I met another crash when I open console in-game:
[00:09:22]: [string "../mods/workshop-2758553790/main/consolemod..."]:239: attempt to index field '?' (a nil value)
LUA ERROR stack traceback:
../mods/workshop-2758553790/main/consolemodder.lua:239 in (method) PostOnBecomeActive (Lua) <204-243>
../mods/workshop-2758553790/main/consolemodder.lua:49 in (method) OnBecomeActive (Lua) <47-50>
scripts/frontend.lua:961 in (method) PushScreen (Lua) <933-966>
scripts/frontend.lua:432 in (method) OnControl (Lua) <410-474>
scripts/input.lua:165 in (method) OnControl (Lua) <162-169>
scripts/input.lua:422 in () ? (Lua) <421-423>
󰀜瑶光󰀜 12 Feb, 2024 @ 7:37pm 
The mod is crashing when I open console on the main screen. I guess opening the console in a place where "TheWorld" is not defined leads to this crash.

Related code segment:

local function getshard()
if G.TheWorld:HasTag "forest" then

Here's the log:

[string "../mods/workshop-2758553790/main/consolemod..."]:196: attempt to index field 'TheWorld' (a nil value)
LUA ERROR stack traceback:
../mods/workshop-2758553790/main/consolemodder.lua:196 in (upvalue) getshard (Lua) <195-201>
../mods/workshop-2758553790/main/consolemodder.lua:237 in (method) PostOnBecomeActive (Lua) <204-243>
../mods/workshop-2758553790/main/consolemodder.lua:49 in (method) OnBecomeActive (Lua) <47-50>
scripts/frontend.lua:961 in (method) PushScreen (Lua) <933-966>
scripts/frontend.lua:432 in (method) OnControl (Lua) <410-474>
scripts/input.lua:165 in (method) OnControl (Lua) <162-169>
scripts/input.lua:422 in () ? (Lua) <421-423>
FriendlyGrass  [author] 7 Feb, 2024 @ 10:00am 
Thanks, will fix asap.
󰀜瑶光󰀜 5 Feb, 2024 @ 3:39am 
@Crestwave is correct. I'm having the same problem.
󰀏Niko 26 Jan, 2024 @ 11:06am 
I am having the same problem as Crestwave.
Crestwave 23 Jan, 2024 @ 12:01am 
This mod currently crashes the game due to changes from update 590113, which moved GetConsoleHistory() under ConsoleScreenSettings and removed GetConsoleLocalRemoteHistory(), among other things.
RICK 21 Jan, 2024 @ 5:02am 
May you update it?
RICK 10 Sep, 2023 @ 7:57am 
typing a.components.floater.do_bank_swap and an enter will strangely cause a new line instead executing it. So I have to type a.components['do_bank_swap'] instead
hamurlik 8 Sep, 2023 @ 7:00pm 
Oh and one more thing, I think this is vanilla behavior. It's the same way in the normal console. Might be asking for too much to fix a vanilla problem, but just be aware.
hamurlik 8 Sep, 2023 @ 6:47pm 
By the way, there is a workaround to this. You could just paste the code in small batches instead of all at once. Still, would be convenient to do it all at once
hamurlik 8 Sep, 2023 @ 6:20pm 
Incredibly useful mod. One problem though, ctrl+v'ing really long text (like a whole function) is cut off and places some non sense symbols at the end. It's "?3/4XEa" except in unicode symbols. Would it be possible to fix this?
米开langelo 26 Apr, 2023 @ 11:11pm 
Pressing the delete key while typing will delete all characters to the left of the cursor, I don't want to do this
FriendlyGrass  [author] 26 Apr, 2023 @ 8:49am 
@My Username
I'm not sure I understand what you mean. Could you explain?
FriendlyGrass  [author] 26 Apr, 2023 @ 8:48am 
@Crestwave thanks, for now I've just bumped up the cut-off like you said.
米开langelo 2 Apr, 2023 @ 8:48pm 
My Backspace btn will always remove all the left before input point.Too crazy.
米开langelo 2 Apr, 2023 @ 8:37pm 
How can Backspace btn only delte a char?
Crestwave 1 Apr, 2023 @ 12:33am 
The scrollable console log width seems to be much too short by default, leading to text getting cut off. Here's a comparison between the vanilla log and the modded log; note the MOTD line:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2955770409
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2955770471

I personally find 1200 to be a much more reasonable scissor_width, but I'm not sure how universal this would be. The vanilla log uses a width of 900, but uses SetModeScale to dynamically scale.
FriendlyGrass  [author] 18 Mar, 2023 @ 9:24am 
Fixed
Boogiepop210 17 Mar, 2023 @ 8:00pm 
I got this error when copy and pasting and sometimes when typing : 00:04:57]: [string "../mods/workshop-2758553790/main/completer...."]:142: bad argument #1 to 'sub' (number expected, got nil)
LUA ERROR stack traceback:
=[C]:-1 in (method) sub (C) <-1--1>
../mods/workshop-2758553790/main/completer.lua:142 in (upvalue) forcewordprediction (Lua) <139-157>
../mods/workshop-2758553790/main/completer.lua:299 in () ? (Lua) <281-340>
=(tail call):-1 in () (tail) <-1--1>
../mods/workshop-2758553790/main/consolemodder.lua:83 in (method) RefreshPredictions (Lua) <82-85>
scripts/widgets/wordpredictionwidget.lua:227 in (method) RefreshPredictions (Lua) <224-346>
scripts/widgets/textedit.lua:228 in (method) OnTextInput (Lua) <205-240>
scripts/widgets/textedit.lua:283 in () ? (Lua) <266-327>
FriendlyGrass  [author] 1 Feb, 2023 @ 7:57pm 
This should be fixed (I couldn't to reproduce it exactly but added checks to ensure against a crash), thanks.
Monti 26 Jan, 2023 @ 5:04am 
I got a crash when clicking in the textbox and then using arrows to change the position of the cursor.
The crash log can be found here:
Crash log [pastebin.com]
RICK 2 Dec, 2022 @ 7:11pm 
Some more suggestions:1.Do not save to history if the command repeats the previous one. 2.Increase the size of history. 3.I wish to have a text edit widget always shown, but only get focus when I click it/hover over it, and otherwise lose focus. Is this possible so that there is no need to open/close console all the time?
FriendlyGrass  [author] 13 Sep, 2022 @ 4:42pm 
Thanks, just submitted a fix for this now.
RICK 13 Sep, 2022 @ 1:12am 
playing Island Adventures, crash on Config.SHARD_LOG_COLOURS[shard], maybe you can test if Config.SHARD_LOG_COLOURS[shard]==nil(indicating neither forest nor caves) before you set colour.
FriendlyGrass  [author] 3 Sep, 2022 @ 7:15pm 
Thanks, @Niko.

I've changed up the current log colours and added a config for an alternative possibly less extreme theme. (This will be in the next update, in a bit.)

This mod doesn't actually currently support shard logs for real dedicated servers because I can't access their cluster folders from the client :(. A server version could theoretically fix this.

Yeah right now the primitive console log is used when the console is not open, and my scrollable, sharded console log overrides it when the console screen is open. I'll look into changing this but I think there are some technical challenges. Have you noticed the game's scrollable chat log is only used when the chat screen is opened?
󰀏Niko 2 Sep, 2022 @ 1:50pm 
Also, a bit of a random question but does/will this mod ever support servers that have more than just 2 shards? I don't expect it to seeing as that is an amazingly niche case, but could be handy on rare occasions.
󰀏Niko 2 Sep, 2022 @ 1:48pm 
Absolutely amazing mod! It has saved me a lot of time and headache.

The only things I can think of improve it is support for ctrl + L (Opens the normal client console instead of this mod's custom console). Oh and this is a bit of personal preference but, I would like if in the config I could tone down the harsh colors of the server/cave consoles. And this isn't as important, but maybe some proper colored inputs would be handy, such as messages that start with/contain the word "Error" be colored red instead of the white/blue/orange of the default text.
FriendlyGrass  [author] 30 Aug, 2022 @ 6:09am 
Oh my! Fix coming.
Bumber 29 Aug, 2022 @ 5:49pm 
Pressing 'c' without holding ctrl is causing stuff to be written to "psuedoclipboard.txt". (Should also be spelled "pseudo".)
RICK 2 Jun, 2022 @ 5:59pm 
@ FriendlyGrass Here is a screenshot of the console. https://www.zzzs.ml/open_file/console.png
FriendlyGrass  [author] 2 Jun, 2022 @ 2:42pm 
Thanks for the suggestions!
I can't see the position issue you see with the console text box. Is it a little lower? Position is messed around with for it to vertically expand nicely in multiline.
An Undo/Redo would be good. I currently use the basic autocompletion engine that the game uses but really I should make my own. Pretty printing tables would be good but first I should make a serverside mod so that that can work on a networked world with caves. Sure I can make an option to make keeping the console open on run the default and +Ctrl to close.
> Persistent console text box
Maybe, I guess if you need to see the console input while you're moving around.

On a side note...
There's endless features that could be added to the game's console to turn it into a fully fledged editor, but wouldn't it be better to just have a little mod that hot reloads a script in your Klei save folder like customcommands.lua so you can write commands in your favorite text editor when you need it?
RICK 30 May, 2022 @ 6:28am 
@ FriendlyGrass Could you adjust the position of text box back to original? it looks out of place. Other features I dream of: word-based sentence history tracking with Ctrl+Z/Y, case-insensitive autocompletion(I see in VS Code, you type small letters to match both, and capitalized to match capitalized), pretty print table so that I do not have to use dumptable(), option for keeping console open and Ctrl to close console, persistent console text box that shows log when focused and hides log when blurred