startup messages lost if '-c set co=<>'

14 views
Skip to first unread message

Ernie Rael

unread,
Mar 7, 2022, 9:38:40 AM3/7/22
to vim...@googlegroups.com
Greetings,

The "Hello World" is not seen after this following command. Note, the
"set co=" actually has to change something.

gvim -u NONE -c "set columns=120" -c 'echomsg "Hello World"'

I've looked through "he :vim-arguments", but may easily have missed
something. It seems like gvim outputs "Press Enter or type command to
continue" but only the green word "continue" shows up, but it's indented
as though the first part of the message is overwritten or ???

I didn't find an option to: execute the commands so far, let vim finish
initialization, then execute remaining command as though they're from
the command line.

-ernie

Bram Moolenaar

unread,
Mar 7, 2022, 10:48:31 AM3/7/22
to vim...@googlegroups.com, Ernie Rael
During startup redrawing is often postponed until all the settings have
been done and the size of the window is known. Then a redraw is done
once Vim is ready for work. This redraw may very well overwrite the
echo'ed message, or give you a prompt before it redraws.

It is hard to do otherwise. If you really want to have the message show
up after all initializations are done, you could use a VimEnter
autocommand:

au VimEnter * echomsg "Hello World"

Or use a timer:

call timer_start(50, {_ -> execute('"Hello World"')})

I haven't tried these commands, might need some tweaks.

--
hundred-and-one symptoms of being an internet addict:
193. You ask your girlfriend to drive home so you can sit back with
your PDA and download the information to your laptop

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Ernie Rael

unread,
Mar 7, 2022, 11:58:45 AM3/7/22
to vim...@googlegroups.com
On 3/7/22 7:48 AM, Bram Moolenaar wrote:
> Ernie Rael wrote:
>
>> The "Hello World" is not seen after this following command. Note, the
>> "set co=" actually has to change something.
>>
>> gvim -u NONE -c "set columns=120" -c 'echomsg "Hello World"'
>>
>> I've looked through "he :vim-arguments", but may easily have missed
>> something. It seems like gvim outputs "Press Enter or type command to
>> continue" but only the green word "continue" shows up, but it's indented
>> as though the first part of the message is overwritten or ???
>>
>> I didn't find an option to: execute the commands so far, let vim finish
>> initialization, then execute remaining command as though they're from
>> the command line.
> During startup redrawing is often postponed until all the settings have
> been done and the size of the window is known. Then a redraw is done
> once Vim is ready for work. This redraw may very well overwrite the
> echo'ed message, or give you a prompt before it redraws.
>
> It is hard to do otherwise. If you really want to have the message show
> up after all initializations are done, you could use a VimEnter
> autocommand:
>
> au VimEnter * echomsg "Hello World"
>
> Or use a timer:
>
> call timer_start(50, {_ -> execute('"Hello World"')})
>
> I haven't tried these commands, might need some tweaks.
>
gvim is getting fired off by mercurial. It's probably true that the only
time you'll see an error during startup is when you're first setting
things up, and of course that's when you'll most want to see an error. I
came across this, because I was testing what happens if python is not
available.

I may play around with timer_start in SpliceInit to display any initial
problems. It looks perfect "when busy or not waiting for input". Thanks.

splice.executable = gvim
splice.args = -f $base $local $other $output -c "set columns=200" -c
SpliceInit

-ernie

Ernie Rael

unread,
Mar 7, 2022, 3:42:31 PM3/7/22
to vim...@googlegroups.com
On 3/7/22 7:48 AM, Bram Moolenaar wrote:

> Or use a timer:
>
> call timer_start(50, {_ -> execute('"Hello World"')})

Works well. (I knew to replace -> with =>, but the bad dict had me going
for a while)

I'd like to do multi-line output. Haven't been able to get it to work.
Any ideas?

I thought to include some best guess instructions, with "instrs:
list<string>" I tried
'echomsg instrs->join("\n")' and several other things. Saw plenty of
returns and nulls (^M, ^@) and other weird things, but haven't been able
to get multi-line output.

Outputting one line at a time left only the last line showing.

Tried putting a "messages" command in, but that didn't work. It works
great from the command line.

I'm output all the stuff to a log, but for that to matter, the user
needs to enable the log.

-ernie

Ernie Rael

unread,
Mar 7, 2022, 5:31:34 PM3/7/22
to vim...@googlegroups.com
On 3/7/22 12:42 PM, Ernie Rael wrote:
> On 3/7/22 7:48 AM, Bram Moolenaar wrote:
>
>> Or use a timer:
>>
>>     call timer_start(50, {_ -> execute('"Hello World"')})
>
> Works well. (I knew to replace -> with =>, but the bad dict had me
> going for a while)
>
> I'd like to do multi-line output. Haven't been able to get it to work.
> Any ideas?
Found popup notification. Looks like that's the way to go.
Reply all
Reply to author
Forward
0 new messages