I'm just starting to use Grunt on OSX. I initialise a folder watch with grunt watch. Every time I make a change and Grunt runs, the dock icon for terminal bounces and a red "1" indicator bubble appears. This is very annoying. Has anybody found a way around this issue?
It looks like grunt is appending the terminal bell character (\x07) to fail messages, see here: https://github.com/gruntjs/grunt/blob/25728e1744836b42927962a005fe1ce15f55640f/lib/grunt/fail.js#L31
Reading the code, it looks like you can disable this terminal bell by specifying the 'color' grunt option (which doesn't make sense to me). You can stick this in the top of your gruntfile:
grunt.option('color', false);
(I would love to know if there is a more elegant way of specifying grunt options.)
I have just successfully suppressed this EXTREMELY annoying behaviour with the following:
1: Open Terminal (given if you're reading this you came here as a result of a bouncing Terminal icon I shouldn't have to point out that it's in Applications->Utilities->Terminal
2: Type the following:
$ defaults write com.apple.dock no-bouncing -bool TRUE
$ kilall Dock
3: Thank the folks over at Switching to Mac who pointed this out.
Related
I'm trying to setup the terminal on my new Mac to match the behavior of my old Mac, however I have run into an issue with my multiline prompt that has me stumped. I remember having this issue when I setup my old Mac several years ago, however I don't remember how I solved it.
My prompt (without color) looks like this:
╭─username ~ 130 ↵
╰─
When I press ⌘commandK in iTerm2 on my old Mac it clears the terminal window so that both lines of the prompt are shown at the top.
When I press ⌘commandK in iTerm2 on my new Mac it clears the terminal window so that only the second line of the prompt is shown at the top.
I have tried checking everything I could think of, I have checked:
Every dot file/directory in my home directory (copied them to the new Mac).
iTerm2 settings.
System settings (primarily keyboard shortcuts).
Various websites with instructions about setting up multi-line prompts.
Interestingly I have discovered that if I type clear iTerm2 will clear the screen and leave the top line showing on both Macs. However it first clears the entire screen, including the prompt, before bringing the prompt back (looks bad imo). However since it works differently ⌘commandK does I don't think that's what my old Mac is doing.
It's possible that I installed some program/script that somehow does this, but if so I'm not finding it locally or referenced online.
Does anyone know how I can get ⌘commandK working to clear the screen while keeping the top line of my prompt? I still have the old Mac so I can check/compare anything on it to the new Mac if there are any guesses about what settings I changed.
Edit:
I was able to find something that worked, however if anyone has any other suggestions I'll be happy to try them and accept any that I can make work that are less hacky than this (e.g. don't require another 3rd party app).
Edit: This doesn't work while a command is running, nor does it clear the scrollable history. So it's better than nothing but still doesn't behave like I want it to.
After coming back to my question SO associated a new question with an answer I was able to make work, although it feels extra hacky and wasn't what I had working before.
I found this answer which suggests using ⌃controlL to clear the screen. That does exactly what I want it to do (leaves the top prompt visible and doesn't flash) but with the wrong keybinding. Fortunately I was able to use an app I already have installed (BTT) to make ⌘commandK map to ⌃controlL only in iTerm2.
I use Ubuntu 18.4 and VS Code. I wanted to know how to unwrap output of a command in integrated terminal?
Is it possible? Also can it be done in Gnome terminal?
#Yedhin Answer Works, but I am unable to scroll horizontally. Which defeats the purpose of unwrapping.
I cant quite understand your use-case yet, but still the way I would read a long single line output would be by piping it to the less command :
my_command_which_produces_long_output | less -S
you can do the same in your terminal emulator as well with the less command.
Edit : I don't know for sure why horizontal scrolling doesn't work with gnome-terminal. For me it works fine with the command less -S. But you can try explicitly setting scrolling by running these commands from your terminal and see if either of them gives your desired results.
gsettings set org.gnome.settings-daemon.peripherals.touchpad horiz-scroll-enabled "true"
synclient HorizTwoFingerScroll=1
If these don't work either, then i strongly suggest you to try out dconf editor and to enable horizontal scroll in the touchpad section in it. If that too is fruitless, then change your terminal emulator something better like:
lightweight : st
fast : alacritty
more gui options : konsole/tilix
Hope this helps. Cheers!
Here I want to ask you to help to bring the console window top most with a shell command. Is it possible?
there was a script execution in my work environment, and will take about several minutes to complete, I will move to other work while running, it is better there are some tips to notify me when script completes run.
So I think bring the window top most is the most direct way.
Please tell me how to achieve this, I'm working on windows, new to MacOS.
Thanks,
Levi
I don't know how to bring the console window to the front, but if you're working in the terminal, you could do something like:
$ path/to/script ; tput bel
or
$ path/to/script ; say "script 1 is done"
Where path/to/script is whatever your usual method of loading the script is.
I recommend the first method, as it flashes the screen, makes a beeping noise, and causes the terminal icon to bounce up and down on my dock in OS X 10.10. The second might be better if you need to figure out which script is done from among a bunch of scripts. If you have coworkers who you don't want to disturb, you can change the preferences in terminal so that an alert only flashes the screen and doesn't also make a noise.
If you have access to the source code of the script, you can also add tput bel or say "command" to the last line of the script and you'll get the same behvaior.
I recently got a mac. I was previously working on a laptop with ubuntu and I was using vim.
I now will discuss about vim in console (iTerm2 or the default terminal) and macvim.
The problem is that some binding don't work under mac. For example I had CTRL left/right for navigating between splits, CTRL up/down to move lines or blocks of code up and down, etc. They don't work anymore.
I had a bunch of plugins (nerdtree, powerline, etc.) that now look weird. Powerline doesn't display special characters in macvim and in terminal they are question marks.
In console, nerdtree looks weird and it doesn't display the special triangle character. If I hit return to open a file selected from nerdtree, it doesn't do anything. In macvim, it works ok.
Is there any guide on how to use vim on mac? Or what is the recommended way?
Nerdtree : let g:NERDTreeDirArrows=0
Powerline : Take a look at the part of strange characters in the document https://github.com/Lokaltog/vim-powerline
Navigating within splits with Ctrl + arrows work on mine. Can you post your vimrc, or try running vim without any configuration.
Ctrl+arrows to move lines and block doesn't work on mine.
Did you check which key was sent by your terminal to vim ?
Did you tried to set it manually ?
I had similar problems with emacs, including one keybinding I'm still not able to reproduce :(
I have the exact same config on my Mac and a Windows box at work, my Ubuntu box at home and a couple of VPSes. It works exactly the same on every platform in GVim/MacVim or in plain Vim.
Unfortunately I don't use either NERDTree nor Powerline but Vdt's answer seems to have all the info needed.
Some of the behaviors you describe are custom mappings. You should show us your ~/.vimrc (the old one on linux and the new one on the Mac, if there are differences) so that we can help you make it more portable.
Also, "looks weird" means nothing: please add a screenshot or two.
I have a bash script that I run to toggle visibility for my desktop icons which is the following:
#!/bin/bash
DESKTOP=$(defaults read com.apple.finder "CreateDesktop")
if [ $DESKTOP == 1 ]
then
defaults write com.apple.finder CreateDesktop -bool false
else
defaults write com.apple.finder CreateDesktop -bool true
fi
killall Finder
it works, but there's 2 issues here I don't know how if it's possible to do using bash.
when running this script it It opens up terminal run the app and leave the terminal opened.
Is there any way to make this script run without have to open the terminal?
I've found this link Making an executable bash file run when clicked which use Platypus as a wrapper for your script, but I would like to know if it's possible to do something natively without any extra tool :)
when running the script the killall Finder makes everything restart so the screen blinks and you lose the actual state of your windows
Is is possible to make only the desktop icons fade-in/out smoothly without affecting windows and other resources based on Finder?
this Camouflage app works like this, so basically I would like to know if it's possible to replicate this behavior using bash script.
Well that's it, I hope it's easy to understand.
You could say that I could use this camouflage app for my needs but actually I'm trying to learn a bit about it and trying to do it myself (and obviously, with your help :)
Thanks in advance
Update
I was having a look at the second issue and I'm not sure but it seems that app in question doesn't hide the icons from destkop but instead, it creates an overlay between the most front level on the desktop(that is over the icons) and generate an image which is the same used as a desktop image. hence the fading effect, since it can control the image transition when appearing. what helped me analyze this was since every time you close the app the icons appear back. So it must have something do to with it.
If I am wrong the it's really possible to do other way, please share your opinion :)
Not sure about a solution for your second question, but for the first: take a look at the third answer for the StackOverflow question you linked to:
Making an executable bash file run when clicked
You can create an application bundle with AppleScript Editor or Automator that will run your script without opening a Terminal window.