The amended line is in bold (return "") and the surrounding lines have been reformatted a bit. Amended on 22 October 2006 to make a change so that this plugins works with MUSHclient 3.80 onwards. return table of lines, concatenated with newlines between each one Table.insert (t, "") - to get final linefeed an execution can be continued (thus after current code block). If the statement is one of return or throw the new line inserted where. Ctrl Shift-Enter inserts new line afther that statement even if the. Change the regular expression (line 3) to match your prompt line, save as Add_Newline_To_Prompt.xml and then install it as a plugin.Īll being well, your prompt lines should now automatically end with a newline, and thus match triggers immediately.ĭetects prompt lines without a newline, and if found, adds one.Ĭhange ENTITY line on 3rd line of plugin to be a regular expression If there's no syntax errors to be fixed in the statement at caret. To use this, just copy below the line, and paste into a text window (notepad window). The lines (saved into table t) are concatenated back into a single string with a newline between each table entry, and returned as the function result.If the regular expression matches, then the final (partial) line is also returned to MUSHclient (with a newline after it) thus effectively adding the newline to the prompt line. This gets passed to the regular expression engine as \x1B to indicate the "escape" character. Note that in the regular expression we have to use two backslashes, as the first is used by Lua to indicate that the second is a "literal" backslash. Since we are expecting that we build it into the regular expression. The very first character is the "Escape" character (hex 1B) which is used in this case to reset colours to the default. The final line (one with no newline after it), is tested against a regular expression which should be set up to match your prompt.All of the lines, except the last one, are just reassembled into normal lines with a newline between them.Sending sig kill, or bugs in less could cause the problem. Ctrl-C should send a sig int, this should be caught, and the reset code run, before exit. It batches the packets into lines, as sometimes lines are split over packets The should but it back, when they are done, but if you kill less with no opportunity for it to run the reset code, then you end up where you are.The plugin below receives all incoming text from the MUD.This can be useful for situations where you want a trigger to match a prompt line the moment it arrives, which it won't normally because trigger matching happens when a newline is received. The binary data has randomly included the former, which is why you can't see what your typing, and reset will include the latter (among others), which will fix it.With the new functionality of OnPluginPacketReceived it is now possible to "fool" MUSHclient into thinking prompt lines have a newline after them, even if they don't. ![]() there is a stop echoing input code and also a start echoing input code. Most of the time, if your terminal is behaving weird in anyway, just running reset will fix it, by simply echoing all the special characters necessary to set the terminal into the basic default mode - e.g. You can experiment by running head /dev/urandom in a new terminal to see what I mean. You may notice the screen clears, flashes, or jumps around - this is all due to these control characters being honoured. When you output binary data (rather than text), the terminal will see these special control characters and try to interpret them as they come through. Text is just text, and is not treated specially by the terminal, but there are also some special characters which aren't text, and are used to do things like move the cursor, clear the screen, change colour, stop echoing output, etc. As other answers suggest, simplest fix is just to run reset.Īs to the cause though? This usually happens when you cat (or otherwise output) a binary file or data to your terminal.
0 Comments
Leave a Reply. |