recentpopularlog in

kme : tui   42

How do I retrieve the terminal width in Perl? - Stack Overflow
<code class="language-perl">use Term::ReadKey;
($wchar, $hchar, $wpixels, $hpixels) = Term::ReadKey::GetTerminalSize();</code>

<code class="language-perl">my $width = `tput cols`;</code>
perl  terminal  tui  shellscripting  solution 
6 weeks ago by kme
rt/ at stable · bestpractical/rt
Has an interactive shell, built-in help, and a dispatcher for command line options.
perl  commandline  tui  samplecode  inspiration 
october 2019 by kme
BurntSushi/tabwriter: Elastic tabstops for Rust. -
Elastic tabstops for Rust. Contribute to BurntSushi/tabwriter development by creating an account on GitHub.
rust  cli  tui  library  tabstops  tabs 
april 2019 by kme
GitHub - twosigma/ngrid: It's "less" for data! |
It's "less" for data! Contribute to twosigma/ngrid development by creating an account on GitHub.
python  commandline  tui  curses  tsv  data  viewertextprocessing  alternativeto  less  vv  csvkit  csvlook 
march 2019 by kme
linux - How do I get "top" command to wrap its output? - Unix & Linux Stack Exchange
Just plain 'top -c' usually does what you want (which is to stop truncating the command name).
<code style="language-bash">top -bcn1 -w512</code>

The elegant solution is to use the option -w [number]. According to the man page, the maximum width is 512 characters, so you will need a different solution for anything exceeding that. Presumably you also want to see the full length of the commands, so use the -c option. We need to run top in "batch mode", -b, or it will continue to cut off the commands with a "+". Batch mode kind of makes a mess because it prints out all the jobs every second, so we can use the -n1 option to print out just one instance.
unix  linux  processmanagement  commandline  tui  annoyance  solution 
july 2018 by kme
python - Print in terminal with colors? - Stack Overflow |
There's a useful gist in the comments (

Using Colorama to wrap stdout or installing ANSI.SYS (wherever you get that nowadays) seems to be required on Windows.
python  tui  colors  shellscripting  ansicolors  crossplatform  solution 
december 2017 by kme
python - Read password from stdin - Stack Overflow |
<code class="language-python">
>>> import getpass
>>> pw = getpass.getpass()
python  security  password  prompt  scripting  tui  batteriesincluded  solution 
december 2017 by kme
ewaters/altsql-shell · GitHub
Quick start:
<code class="language-bash">
sudo apt-get install cpanminus
sudo cpanm Time::HiRes Moose App::AltSQL

Non-root installs work fine as long as you:
<code class="language-bash">
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
# and
cpanm Time::HiRes


The author's motivation:

Here are a few of those issues:

Ctrl-C kills the program

All of the shells that we used on a daily basis allow you to abandon the half-written statement on the prompt by typing Ctrl-C. Spending all day in shells, you expect this behavior to be consistent, but you do this in mysql and you will be thrown to the street. Let's do what I mean, and abandon the statement.

Wide output wraps

We are grateful that mysql at least uses ASCII art for table formatting (unlike sqlite3 for some reason). But there are some tables that I work with that have many columns, with long names (it's often easier to keep adding columns to a table over time). As a result, when you perform a simple select * from film limit 4 you quickly find your terminal overwhelmed by useless ASCII art attempting (and mostly failing) to provide any semblance of meaning from the result. You can throw a '\G' onto the command, but if it took 10 seconds to execute and you locked tables while doing it, you could be slowing down your website or letting your slave fall behind on sync.

Suffice it to say, it's a much better experience if, just like with git diff, wide output is left wide, and you are optionally able to scroll horizontally with your arrow keys like you wanted in the first place.
mysql  dba  shell  tui  commandline  terminal  alternativeto  webdevel  mysqlconsole  annoyance  fuckina  console 
january 2014 by kme

Copy this bookmark:

to read