Walraven // Forums // Thread 511

wiz commands should be run through more so they don't get cut off, athenon, 2003-04-01 12:16:36
This idea reported by Athenon

wiz commands should be run through more so they don't get cut off
huh?, malap, 2003-04-02 15:17:43
What's wrong with them? I don't understand this description.
25-line telnet, acius, 2003-04-03 13:01:41
People who don't have scrollback on their clients might appreciate having the results of the command run past them in bite-size chunks. As in,

wi env | more

... This would also fix a lot of broken things, like ls /bin/soul, which is now beyond redemption.
idea, allaryin, 2003-04-09 14:34:31
Perhaps the solution is to make msg break things up? Before sending output to the player, make msg check how long the string is. If it exceeds the player's terminal height (which we'd default to 24 lines for xterms :P) then the string is 'piped through more'.
term size, allaryin, 2005-05-15 12:20:24
Well, we now actually store terminal size preferences for people, so the page breaks could be even more intelligent than they would have been two years ago.

I see this as a major needed function - especially for long help files. I am offering a substantial bounty for this feature. Create a demo object that will allow demonstration of the function - cf the wiz more command and the msg() function.

Since msg is a simul_efun and is therefore slightly inaccessable by non-admin, here is the code:

varargs void msg(string words, int indent ) {
if( !this_player() )
wrap_width = 0;
else
wrap_width = this_player()->query_term_width();
if( !wrap_width )
wrap_width = 80;

words = break_string(process_ansi(eval_exp(process_grammar(words), previous_object())), wrap_width - 1, indent) + "\n";

if( this_player() )
this_player()->catch_tell( words, previous_object(), 1 );
else
write( words );
}
<< forum