On the Mac, dia
(specifically /Applications/Dia.app/Content/Resources/bin/dia
) is just a shell script wrapper to the compiled dia-bin
binary. It sets a number of environmental variables, and then finishes by executing Dia as a GUI:
exec "$CWD/dia-bin" --integrated
You can make a copy (e.g. cp -p dia dia-cmd
) and edit that last line in dia-cmd
to become:
"$CWD/dia-bin" $@
and then you can use it as dia-cmd
within the terminal.
Note: I found that for my locale (en_US.UTF-8), at least, running dia-cmd
in the terminal was way too chatty about trying to determine the correct locale, spewing ignorable warnings:
Warning: AppleCollationOrder setting not found, using AppleLocale.
Setting Language: en.UTF8
(process:33043): Gdk-WARNING **: locale not supported by C library
(process:33043): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
You can eliminate that by also commenting-out those lines in dia-cmd
, and manually forcing the correct locale:
## LANGSTR=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null`
## if [ "x$LANGSTR" == "x" ]
## then
## echo "Warning: AppleCollationOrder setting not found, using AppleLocale." 1>&2
## LANGSTR=`defaults read .GlobalPreferences AppleLocale 2>/dev/null | \
## sed 's/_.*//'`
## fi
# NOTE: Have to add ".UTF-8" to the LANG since omitting causes Dia
# to crash on startup in locale_from_utf8().
## export LANG="$LANGSTR.UTF8"
export LANG="en_US.UTF-8"
## echo "Setting Language: $LANG" 1>&2
Voila:
MYMACHINE:~ lars$ /Applications/Dia.app/Contents/Resources/bin/dia-cmd -v
Dia version 0.97.2, compiled 18:51:13 Mar 17 2012
I believe this is not possible without using fullscreen mode - vim is using fullscreen mode (python -c 'print "\x1b[?1049h"'
) which disables vertical scrolling as well, which isn't what I want (though this wasn't clear in the question).
Also, it turns out this behavior isn't specific to terminal.app - it's how all the terminals I've tried work.
Best Answer
You mean in a single keystroke? No.
Depending on whether the daemon supports restarting itself/reloading its configuration, you might be able to restart it with a HUP, e.g.
but A. that's not a keystroke, and B. it requires the daemon to have code to support doing that.