recentpopularlog in

kme : terminal   191

« earlier  
slowcat.py - print a file slowly
This works, whereas 'slowcat.c' didn't for some reason (on macOS).
unix  linux  terminal  textprocessing  utility  software 
9 weeks ago by kme
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>

Or:
<code class="language-perl">my $width = `tput cols`;</code>
perl  terminal  tui  shellscripting  solution 
11 weeks ago by kme
Development notes: Search results for dircolors | https://wills-tech-notes.blogspot.com/
<code class="language-bash">
export LS_COLORS=$(echo $LS_COLORS|sed 's/di=01;34/di=01;36/')
</code>
unix  terminal  shell  colors  annoyance  directory  ls  dircolors  solution 
december 2019 by kme
bash - How to set Readline key bindings using ALT (Meta) or some other control key as prefix instead of `C-` and `e`? - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
There are too many questions in one question, but this one's interesting:
Furthermore, how can I control the "timeout" that should occur before a key binding, that is a prefix of a longer key binding, is executed?
macos  inputrc  keybindings  terminal.app  terminal 
december 2019 by kme
A (slightly) simpler command-line Spotlight search
Any qualified Spotlight query should be usable with "-interpret", so go ahead with
<code class="language-bash">mdfind -interpret "kind:image flash:1 modified:<=1/1/08 ex-girlfriend"</code>
to find those late-night pictures of last year's special someone.
macos  spotlight  metadata  mdfind  commandline  shellscripting  terminal  searchandindex  tipsandtricks  alternativeto  find 
september 2019 by kme
macos - How to run mvim (MacVim) from Terminal? - Stack Overflow
My solution: add /Applications/MacVim.app/Contents/bin to the PATH.
macvim  macos  console  terminal  cli  movein  solution 
september 2019 by kme
A minimalist guide to tmux | Hacker News
Well, I was half-joking :-) and I did expect that few people would know about C-\ for SIGQUIT. Myself, I find it very useful for programs written by people who think it's a good idea to capture SIGINT (it's not), because same people (and I will refrain from using adjectives) forget about SIGQUIT most of the time. Which means I can quickly kill a misbehaving program without typing something in a separate shell.
tmux  terminal  multiplexer  jobcontrol  keybindings  tipsandtricks 
july 2019 by kme
windows - How to fix PuTTY showing garbled characters? - Server Fault
The analogous fix on CentOS (7) is to use 'localectl', maybe, except that requires DBus to be running, which it isn't for a fresh-out-of-the-box Docker container. ¯\_(ツ)_/¯
If the locale returns something like POSIX, issue
<code class="language-bash">update-locale LANG=en_US.utf8</code>
at the command line - see thomas-krenn.com/de/wiki/Locales_unter_Ubuntu_konfigurieren – koppor Dec 19 '15 at 11:05
docker  utf8  characterencoding  locale  mojibake  terminal  unix  shell  ubuntu  solution  centos  sortof 
june 2019 by kme
GitHub - skywind3000/z.lua: A new cd command that helps you navigate faster by learning your habits
Via: https://www.linuxuprising.com/2019/02/zlua-faster-way-of-changing-directories.html
A new cd command that helps you navigate faster by learning your habits :zap: - skywind3000/z.lua
Paste this script in your .bashrc / .zshrc:
<code class="language-bash">function j() {
if [[ "$argv[1]" == "-"* ]]; then
z "$@"
else
cd "$@" 2> /dev/null || z "$@"
fi
}</code>

When you are using j xxx it will first try cd xxx and then z xxx if cd failed.
bash  shell  cli  lua  producitivity  terminal  frecency  alternativeto  fasd  autojump 
june 2019 by kme
jart/hiptext: Turn images into text better than caca/aalib
Turn images into text better than caca/aalib. Contribute to jart/hiptext development by creating an account on GitHub.
cli  terminal  asciiart  library  utility  software  alternativeto  libcaca 
may 2019 by kme
GitHub - slap-editor/slap: Sublime-like terminal-based text editor
Sublime-like terminal-based text editor. Contribute to slap-editor/slap development by creating an account on GitHub.
editor  terminal  cli  console  nodejs  sublime  texteditor  alternativeto  sublimetext 
may 2019 by kme
bash - LINES and COLUMNS environmental variables lost in a script - Stack Overflow
Solution:
<code class="language-bash">lines=$(tput lines)
columns=$(tput cols)</code>

More context:
Often, on modern systems, the $COLUMNS and $LINES variables are not environment variables. The shell sets these values dynamically after each command and we usually cannot access them from non-interactive scripts. Some programs respect these values if we export them, but this behavior isn't standardized or universally supported.

Instead, the stty and tput utilities provide portable means to determine the terminal size from a script (the commands described below are currently undergoing standardization for POSIX)
bash  shellscripting  posix  tput  terminal  solution 
may 2019 by kme
busyloop/lolcat: Rainbows and unicorns! | https://github.com/
Rainbows and unicorns! Contribute to busyloop/lolcat development by creating an account on GitHub.
ruby  gem  terminal  color  lolcat  rainbow  fun 
march 2019 by kme
command line - Markdown Viewer - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
Brett Terpstra's 'mdless' is still prettier, and it's as easy as a 'gem install mdless'.
markdown  terminal  commandline  cli  viewer  workaround  solution 
march 2018 by kme
axiros/terminal_markdown_viewer: Styled Terminal Markdown Viewer | https://github.com/
See also: https://github.com/ttscoff/mdless
The ones I know of (and which made me write mdv ;-) ):

1. There are quite a few from the js community (e.g. msee, ansidown, ansimd and also nd which is great) but they require nodejs & npm, which I don't have on my servers. Also I personally wanted table handling and admonition support throughout and prob. too old to hack other peoples' js (struggling enough with my own). But have a look at them, they do some things better than mdv in this early version (I try to learn from them). Also this would be worth a look ;-)
2. pandoc -> html -> elinks, lynx or pandoc -> groff -> man. (Heavy and hard to use from within other programs. Styling suboptimal)
3. vimcat (Also heavy and hard to use inline in other programs)

Summary: For production ready robust markdown viewing (e.g. for your customers) I recommend nd still, due to the early state of mdv. For playing around, especially with theming or when with Python, this one might be a valid alternative to look at.
markdown  terminal  cli  commandline  viewer  alternativeto  mdless 
march 2018 by kme
弁財天: ** (mate-terminal:5488): WARNING **: Error retrieving accessibility bus address:
I don't think recent versions of GNOME Terminal have the '--disable-factory' switch any more.

<code>Exec=mate-terminal --disable-factory</code>
gnome  gnometerminal  terminal  linux  errormessage  maybesolution 
january 2018 by kme
Tilix: VTE Configuration
2. OR use a login shell

Enable the option in your Tilix Profile (under Preferences) to use a login shell, the screenshot below shows the option that needs to be checked.
tilix  terminix  vte  terminal  linux  annoyance  configsettings  workaround  maybesolution 
november 2017 by kme
Tilix: A tiling terminal emulator
https://launchpad.net/~webupd8team/+archive/ubuntu/terminix

<code class="language-bash">
sudo add-apt-repository ppa:webupd8team/terminix
sudo apt-get update
</code>
terminal  term  xterm  gtk3  d  dlang 
november 2017 by kme
No value for $TERM and no -T specified - Ask Ubuntu
Maybe 'if test -t 1' is better ("if stdout is connected to a terminal"), because what `tty` does is "print the file name of the terminal connected to standard input."


This breaks colors if the input to your script is coming from a pipe, which is usually not what you want.
If you do this

<code class="language-bash">
if tty -s
then
: # your tput commands
fi
</code>

It will fix your problem. Without the -s option tty will either display your tty or write "not a tty"
tput  terminal  bash  ansi  color  shellscripting  maybesolution 
september 2017 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read