it doesn't show numbers at end  
if you run it as single line command in a standard Caché terminal supporting $X,$Y.

newline sets $x=0, $i($Y)

USER>f i=1:1:100 w:i#3=0 "Fizz" w:i#5=0 "Buzz" w:'$x i w !
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53

Your terminal prompt can be configured to display the instance. 

see TerminalPrompt  eg.  config>namespace>

[Startup]    TerminalPrompt="3,2"

and you name your config  "SMP<portnumber>"    which should be valid.
eventually only "<portnumber> " might do it as well.

On the page System Administration > Configuration > Additional Settings > Startup, in the TerminalPrompt row, select Edit.

ENSEMBLE may have some signal mechanic.

BUT at Caché level you still have Special Variable $HALT as the last chance handler.
all details https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_vhalt

Most important: 

If you have $HALT set and also have code defined for ^%ZSTOP when a HALT is issued, the $HALT is executed first. $HALT can prevent the termination of the process, if its halt trap routine does not contain a HALT command.   !!!!