jQuery终端:如何在不换行的情况下回显

时间:2019-07-31 11:15:58

标签: jquery-terminal

是否可以在不引起换行的情况下回显?例如,假设我想让三个点彼此一秒钟出现:

        async void OnSaveButtonClicked(object sender, EventArgs e)
    {
        var note = (Note)BindingContext;
        note.Date = DateTime.UtcNow;
        note.Gender = (string)myPicker.SelectedItem;
        await App.Database.SaveNoteAsync(note);
        await Navigation.PopAsync();
    }

当前显示为:

this.echo(".");
await sleep(1000);
this.echo(".");
await sleep(1000);
this.echo(".");

但是我需要它显示为:

.
.
.

1 个答案:

答案 0 :(得分:1)

对于版本@App:name("ReceiveAndOutput") @Source(type = 'http', receiver.url='http://localhost:8006/productionStream', basic.auth.enabled='false', @map(type='json',fail.on.missing.attribute='false', @attributes(name='$.item', amount='$.charge'))) define stream SweetProductionStream (name string, amount string); @sink(type='log') define stream OutputStream (name string, amount string); -- Count the incoming events @info(name='query1') from SweetProductionStream select default(name, 'DefaultName') as name, default(amount, '0.0') as amount insert into OutputStream; ,您可以使用:

2.8.0

它将为回显添加新的选项(脚本是回显的猴子补丁,但比示例中的脚本好一点,并且具有单元测试范围)。

<script src="https://unpkg.com/jquery.terminal@2.8.0/js/echo_newline.js"></script>

然后,如果您输入命令“ foo”,您将:

this.echo(".", {newline: false});
await sleep(1000);
this.echo(".", {newline: false});
await sleep(1000);
this.echo(".", {newline: false});

,如果您用换行符回音点(默认为true),您将拥有:

...> foo
> |

您甚至可以使用:

....
> |

在将来的版本中,我可能会为整个终端引入选项换行符,这样您将始终需要为具有该选项的终端添加term.echo('hello ', {newline: false}); term.echo('foo\n', {newline: false}); (但是您仍然需要该\n文件)。

相关问题