| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/22851
follow up https://github.com/nim-lang/Nim/pull/22873
|
|
|
|
|
|
|
|
|
|
|
| |
This would be handy for making terminal apps which display content below
the prompt (e.g. `fzf` does this).
Need to test it on windows before I remove "draft" status.
---------
Co-authored-by: Matt Rixman <MatrixManAtYrService@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
| |
* handle out of range value for `COLUMNS` / `LINES`
Querying terminal size may fail with a `ValueError` if size is too big.
Return highest possible value instead. Note that `ValueError` is also
reported on underflow (negative size) but that is out of POSIX specs.
* `parseSaturatedNatural`
|
|
|
|
|
|
|
| |
In POSIX Base Definitions Section 8.1 Environment Variable Definition,
it is explained that the `COLUMNS` and `LINES` environment variables,
if present, take precedence over any other implementation-defined method
to determine the terminal size. This is useful, for example, to capture
output programmatically in simulations for various terminal sizes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* system refactor, move out 600 lines
* compilation, slice, backwardsindex, misc_num moved out of system
* some procs/types moved into arithmetics, basic_types
* system no longer depends on syncio
* some procs moved around to fit with their surroundings
* make exceptions an import, old ops to misc_num
* move instantiationInfo back
* move back nim version, fix windows echo
* include compilation
* better docs for imported modules, fix unsigned ops
also remove ze, ze64, toU8, toU16, toU32 with nimPreviewSlimSystem
* fix terminal
* workaround IC test & weird csize bug, changelog
* move NimMajor etc back to compilation, rebase for CI
* try ic fix
* form single `indices`, slim out TaintedString, try fix IC
* fix CI, update changelog, addQuitProc
* fix CI
* try fix CI
* actually fix CI finally hopefully
* Update lib/system/compilation.nim
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* update kochdocs
* hopefully fix csize uses for slimsystem
* fix tquit
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* move io out of system
* fix tests
* fix tests
* next step
* rename to syncio
* rename
* fix nimscript
* comma
* fix
* fix parts of errors
* good for now
* fix test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update terminal.nim
- Added some extra docs to cursorUp/Down/Forward/Backward
- I was able to use hideCursor and showCursor without adding stdout, removed the parameter
- Added docs to terminalHeight()* and terminalWidth()*
* Update lib/pure/terminal.nim
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Update lib/pure/terminal.nim
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Added back f: file to cursor movement
* Removed unnecessary comments
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
|
|
|
| |
Add simple progress bar example to terminal module
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Revert "add missing import to asynchttpserver's example"
This reverts commit 7ef364a402d3d827f10c893280f8dc7b9ef056f5.
* alternative to #18185
* add std/mutexes
* cvlose #17696
* Revert "add std/mutexes"
This reverts commit 69abc8b64954206da6ffe5fc40a1142b39777762.
* tiny
* test
* improve terminal docs
* follow advice
|
| |
|
| |
|
| |
|
|
|
|
| |
ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764)
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
|
|
|
|
|
|
|
|
| |
Console apps in Windows implementation can raise OSError so I've fixed it, see below some examples for reference:
- https://github.com/nim-lang/Nim/blob/c07807bedf1749fa9d3e826d3d736907fefbe568/lib/pure/terminal.nim#L170
- https://github.com/nim-lang/Nim/blob/c07807bedf1749fa9d3e826d3d736907fefbe568/lib/pure/terminal.nim#L178
- https://github.com/nim-lang/Nim/blob/c07807bedf1749fa9d3e826d3d736907fefbe568/lib/pure/terminal.nim#L191-L192
- https://github.com/nim-lang/Nim/blob/c07807bedf1749fa9d3e826d3d736907fefbe568/lib/pure/terminal.nim#L196-L197
- ...
|
|
|
|
|
| |
Since #8296, fgSetColor is no longer a global. These commands were
probably left out from the change as an oversight, so some tests have
been added to make sure this won't happen again.
|
| |
|
|
|
|
|
| |
* add testcase for #5926
* fix #12759
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix sticky colors in styledWrite
* nimgrep: context printing, colorthemes and other
* add context printing (lines after and before a match)
* nimgrep: add exclude/include options
* nimgrep: improve error printing & symlink handling
* nimgrep: rename dangerous `-r` argument
* add a `--newLine` style option for starting matching/context
lines from a new line
* add color themes: 3 new themes besides default `simple`
* enable printing of multi-line matches with line numbers
* proper display of replace when there was another match replaced at
the same line / context block
* improve cmdline arguments error reporting
|
| |
|
| |
|
| |
|
|
|
|
| |
--styleCheck:error
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* fix #9394 by replacing `fmt` with normal string append
Until issue #7632 is fixed, use string append.
* use `strutils.%` instead of normal string add
|
| |
|
|
|
| |
* Also fix deprecated callsite().
|
|
|
| |
The Style enum needs to be an Ordinal so that it can be used in sets.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Support setting foreground/background colors to terminal defaults
Adds fgDefault to ForegroundColor and bgDefault to BackgroundColor
enums.
For Windows console, the default foreground color is assumed to be
white, and the default background color black.
* Add default fg/bg color caching for Windows Console
|
|
|
|
|
|
|
|
| |
This also fixes a bug in the styledWriteLine behavior where the background color
leaked onto the next newline if that command did not end with resetStyle.
Now it is not necessary to end styledWriteLine calls that set BackgroundColor to
end in resetStyle.
|
|
|
|
|
|
|
|
|
|
|
| |
Also:
- Move the tests block to the end of the file
- Fix the older tests
- Add tests for existing styledEcho
- Add new tests for styledWrite
Fixes https://github.com/nim-lang/Nim/issues/8046.
|
|
|
|
|
|
|
| |
\e[3m -> italic
\e[9m -> strikethrough
On terminals not supporting italic text, the text is shown in reverse instead,
and on terminals not supporting strikethrough text, the text is shown as is.
|
|
|
|
| |
The interface is similar to escapeJson
|
| |
|
|
|
|
| |
codes as strings.
|
|
|
|
|
|
|
|
|
|
| |
* Fixes #7764
* Change KEY_RECORD_EVENT filter
* Update terminal.nim
* Revert changes and modify readPasswordFromStdIn
|
|
|
| |
Setting the option to true, then to false would not turn off bright attribute.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|