how to setting ncurses size by lines - ncurses

I'm building a GO game with ncurses, in the game it is about 19 lines.
I want make ncurses adjust font size by size of the window to make it always display 19 lines.
How to do this in ncurses? Thanks

ncurses doesn't set the size of the terminal. If the terminal has at least 19 lines, you can set the LINES environment variable, to tell ncurses to use only the first 19 lines of the screen (but expect some clearing/printing outside that range, since that's not the intended use of the variable).

Related

what is the difference between cterm color and gui color?

I am customizing my own color scheme for Vim but I don't know when should I configure ctermfg/ctermbg variable and guifg/guibg variable because I didn't see any differences between them at all. Is there any difference between them?
Can any one give me an illustrative example of how to use them ?
Thanks
I didn't see any differences between them at all
ctermxx is used by console version of Vim (when set notermguicolors). guixx is used in GVim, or in console if set termguicolors, and the console is capable of TrueColor, obviously. Hence you must test it in different programs to see the difference.
Also, some colors could be the same or very close to each other, e.g. "blue" is "blue" both in GUI and console.
Can any one give me an illustrative example of how to use them?
hi Normal guifg=#1034a6 guibg=#f5f5dc ctermfg=19 ctermbg=230
Should look very similar but still a little different in GUI and console
For symbolic colors names see :h cterm-colors and $VIMRUNTIME/rgb.txt. The cheat sheet of 256 color indexes for console is available here.
The separate pairs allow you to specify different colors for a terminal (which may limit you to a fixed-sized palette of colors, usually 16 or 256) and a GUI (which typically provides a much larger palette or even direct access to any color your display can handle).
For example, if you start a session in your terminal using vi some_file.txt, then ctermfg and ctermbg would be used. If you start an instance of gvim (which opens its own window independent of your terminal emulator), then guifg and guibg are used instead.

How do you change the font size in neovim?

I only case about the font size, I want nothing to do with the font other than its size set guifont makes me put in a font, therefor its useless to me.
Update: all of the answers here weren't what I was asking for but I gave up on trying to fix it and moved on to using vim on Cmder.
For nvim-qt used in Windows, the following command works after nvim-qt has started:
execute join(["GuiFont! ", split(GuiFont, ":")[0], ":h14"], "")
With your font size in place of 14.
To set the font size at start, you have to use ginit.vim instead of init.vim, since init.vim starts before the GUI is loaded. Location of ginit.vim is C:\Users[User]\AppData\Local\nvim.

Temporarily colour Linux Terminal foreground and background text

How can I temporarily set the colors of my Linux Terminal? I wish to add to a script, a color setting so that I remember to run the partner script a few minutes later. The color change would be set on in one script and removed in the other and would act as a visible reminder to me.
So the color change needs to be applied after the terminal is started up and needs to stay for all subsequent typing until it is removed by another equivalent command.
My terminal is GNOME Terminal 2.31.3
There's more than one way to change colors. VTE (the actual terminal within GNOME Terminal) implements these features (generally from xterm):
"ANSI color" escapes (which would be useless to you, since many programs reset those)
changing the text foreground and background using non-ANSI dynamic colors (resetters are rare)
changing the color palette (again, resetters are rare)
The latter two are documented in XTerm Control Sequences, in the section Operating System Commands:
OSC Ps ; Pt BEL
OSC Ps ; Pt ST
gives the form of the control sequence, e.g., escape]Ps;PtBEL
The dynamic colors are described here:
The 10 colors (below) which may be set or queried using 1 0
through 1 9 are denoted dynamic colors, since the correspond-
ing control sequences were the first means for setting xterm's
colors dynamically, i.e., after it was started. They are not
the same as the ANSI colors. These controls may be disabled
using the allowColorOps resource. At least one parameter is
expected for Pt. Each successive parameter changes the next
color in the list. The value of Ps tells the starting point
in the list. The colors are specified by name or RGB specifi-
cation as per XParseColor.
and other colors here:
Ps = 4 ; c; spec -> Change Color Number c to the color spec-
ified by spec. This can be a name or RGB specification as per
XParseColor. Any number of c/spec pairs may be given. The
color numbers correspond to the ANSI colors 0-7, their bright
versions 8-15, and if supported, the remainder of the 88-color
or 256-color table.

Is there a way to set the default size of a plot window?

I would like to change the default size of an R plot window. Does anyone know if there is a configuration setting for this?
Your default size of a plotting window can be set using windows.options() or X11.options() with the width and height parameters. I think setting the defaults using windows.options() also sets them for X11 devices, at least on my windows machine. On Linux, X11 is used as a graphics device and thus you should be able to use X11.options() for your needs. If you want to save these defaults across R sessions, in the examples of http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/x11.html you can find a way this can be done.
If you want to set the size of the plot window to 600x600, say, add this line to ~/.Xresources:
R_x11*geometry: 600x600
and reload the file with
$ xrdb -merge ~/.Xresources

What 12 hex digits color codes in xfce terminal configuration means?

Recently I set up my XFCE terminal to use the perfect palette of
Solarized using this prepared config.
All works fine (although midnight commander colors make me cry now) but one thing is really curious to me:
Why do color codes in xfce terminal settings contain 12 hex digits rather than 6? Like these one:
ColorPalette8=#d3d3d7d7cfcf
What does it mean? And how is it related to color codes specified on
official page
GTK uses 16 bits per colour channel, i.e. 4 hex digits. A colour value for GTK can be encoded as #rgb, #rrggbb or #rrrrggggbbbb.

Resources