Ok, thank you
Now, <esc> closes only the active window, which is I think intended!
Ok, thank you
Now, <esc> closes only the active window, which is I think intended!
On Mac my window system has still difficulties with the size (and placement) of the windows in “dp”. Is it possible to switch off the size and placement choice eventually by an option or global variable flag?
https://github.com/dtschump/gmic/commit/019e1ca8169db696cccf4d91e4279bd6621e9fa6
should fix that for you. Will be ready in 30mn or so…
Very good, still
echo $OSTYPE
darwin18.7.0
Perhaps better to test only the beginning 6 chars!
That’s right, good catch
https://github.com/dtschump/gmic/commit/63a6310e9cdc85cdb5cab618a98aef5c4dba6465
[gmic] *** Error in ./dp/_display_parallel/*if#2946/_display2d/*repeat#2151/*local#2151/*substitute/is_mac/ (file ‘sw/gmic/src/gmic_stdlib.gmic’, line #23207) *** Item substitution ‘{!find([’’],‘darwin’)}’: Function ‘find()’: First argument has invalid type ‘scalar’ (should be ‘vector’), in expression ‘!find([’’],‘darwin’)’.
That means $OSTYPE
is not defined ?
Hum that is strange…
I mean, $OSTYPE
should be available in G’MIC.
What do you get with:
$ gmic echo \$OSTYPE
?
Hmm
/Users/karo $ echo \$OSTYPE
darwin18.7.0
/Users/karo $ gmic e \$OSTYPE
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./
[gmic]-0./ End G’MIC interpreter.
/Users/karo $
Strange:
/Users/karo $ export OSTYPE=darwin123456
/Users/karo $ gmic e ${OSTYPE}
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ darwin123456
[gmic]-0./ End G’MIC interpreter.
That is unexpected.
If $OSTYPE
is an environment variable, then it should be accessible in G’MIC (it does a getenv()
for that, in l.4781 of gmic.cpp
).
So I suspect your environment variable is not passed to gmic
, which is a bit insane, as that should be the role of an environment variable (so that executables can detect in which environment they run).
Another Mac weirdness ?
At this point, I have no other ways to detect that gmic
is running on darwin!
If I type “env” there is no variable OSTYPE, still it is found with $ echo $OSTYPE. Possibly that is zsh internal defined. I’ll try with bash!
And do you think there could be an environment variable specific to darwin that I could test inside G’MIC ?
At least under “env” I don’t see any!
What about a user defined one e.g. GMIC_MAC ? I hesitated already if this strong solution is good for all other mac users. Those with one large monitor might prefer the comfortable placement and size solution for this mode?
I don’t know.
I’d say, you are the one who use gmic
on a Mac, so you decide what is the best to do.
Then you tell me, and I’ll do it
I’m not such a typical Mac user, still actually I have
GMIC_SYSTEM_PATH=/Users/karo/.cache/gmic
GMIC_PINK_VERBOSE=0
GMIC_PINK_NO_RM=0
Maybe a boolean GMIC_MAC or some sort of GMIC_OSTYPE=$OSTYPE could help. Still I hesitate to have to system specific things. The latter would be quite near the linux system!
Maybe we can use the result of uname
to detect a MacOSX system inside G’MIC, so we can avoid having to define an additional variable.
What the output of uname
for you ?
Yes, a solution
/Users/karo $ uname
Darwin
I am using gnu extensions, still uname from apple is the same! Still that won’t allow any possibilities for other Mac users!
Does this command work for you ?
#@cli is_macosx
#@cli : Return 1 if current computer OS is Darwin (MacOSX), 0 otherwise.
is_macosx :
if !narg($_is_macosx) l[]
file=${-path_tmp}gmic_uname
x "uname >"$file
it $file
_is_macosx={same(crop(),'Darwin',6,0)}
rm
onfail _is_macosx=0 rm
endl fi
u $_is_macosx
Test with
$ gmic e \$\{-is_macosx\}
Thanks.
Ok, result is “1” under zsh and bash, but that should not matter. Hopefully nobody will try “dp” under the plugin, app environment is quite different compared to terminal processes!
OK, so I add the is_macosx
command, and test it in display2d
to avoid window moving/resizing on a Mac environment.