gnome-terminal

How to prevent inputs being flushed into output?

[亡魂溺海] 提交于 2019-12-05 13:28:55
I'm on Ubuntu. When I run ghci on Terminal and do this: Prelude Control.Monad System.IO> forever $ getChar >>= print The result is something like this: a'a' b'b' C'C' %'%' \'\\' 1'1' ''\'' "'"' ^X'\CAN' ^?'\DEL' ^CInterrupted. That is, the characters I type in my keyboard are being flushed into output. How can I prevent this and have only print as the writer? To prevent input being flushed into the output (or "echoed"), use hSetEcho stdin False . Prelude> import System.IO Prelude System.IO> import Control.Monad Prelude System.IO Control.Monad> hSetEcho stdin False Prelude System.IO Control

zsh tab completion bug on ubuntu

亡梦爱人 提交于 2019-12-05 04:40:02
I'm getting a really annoying bug here: % git s<TAB> becomes % git sgit s send-email -- send collection of patches as emails send-pack -- push objects over git protocol to another repository ... It just duplicates the command. If I resize the screen, it goes back to normal: git s How do I fix this? BPm I got it! Darn. It's my prompt instead of: PS1=$'%B%F{$fg[green]%}${PWD/#$HOME/~}%{$reset_color%} git-prompt ${VIMODE} ' I should just do PS1=$'%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}git-prompt ${VIMODE} ' And everything works fine now... 来源: https://stackoverflow.com/questions

How can I open Google Chrome from the terminal with the URL “localhost:3000”?

只愿长相守 提交于 2019-12-05 03:08:13
Whenever I try to open Google Chrome with the URL "localhost:3000" it messes up and simply opens a blank tab with no URL. After some testing I've figures out it is the ":" messing it up. This works: $ google-chrome www.gmail.com but this does not work $ google-chrome localhost:3000 nor this $ google-chrome "localhost:3000" How can I open Google Chrome with this URL? I am using Ubuntu, bash script, and the gnome-terminal. Have you tried? google-chrome http://localhost:3000 Got the following message: zsh(or bash): command not found: google-chrome (or chromium-browser) Solved my problem: open

How to remember multiple tabs' session in terminal? (Alike FF session manager)

淺唱寂寞╮ 提交于 2019-12-03 17:05:12
问题 how does one " undo close-tab " in terminal? And quite related to it, is it possible to remember a session of tabs in terminal ? I mean (alike Firefox) if I close all tabs in a particular terminal window, how do I open with same the next day? Its really useful to remember the terminal session for people like me who use multiple tabs a lot, and do not wish to start the next day with remembering what (and whereall) one was working, when one left the desk the day before. In mouse right-click

How to remember multiple tabs' session in terminal? (Alike FF session manager)

戏子无情 提交于 2019-12-03 05:59:34
how does one " undo close-tab " in terminal? And quite related to it, is it possible to remember a session of tabs in terminal ? I mean (alike Firefox) if I close all tabs in a particular terminal window, how do I open with same the next day? Its really useful to remember the terminal session for people like me who use multiple tabs a lot, and do not wish to start the next day with remembering what (and whereall) one was working, when one left the desk the day before. In mouse right-click menu of gnome-terminal, one could easily (and I have ) mistakenly click close tab instead of ' Copy 'and

Communication between two gnome-terminal sessions

大憨熊 提交于 2019-12-02 23:37:02
问题 I have python program main.py import subprocess p = subprocess.Popen( "/usr/bin/gnome-terminal -x 'handler.py'", shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE) p.stdin.write('Text sent to handler for display\n') where handler.py is #!/usr/bin/python print "In handler..." Program main.py opens a new gnome-terminal and runs handler.py to display "In handler...". How can I get handler.py to receive and print "Text sent to the handler for display" sent from main.py? The answer

Communication between two gnome-terminal sessions

泄露秘密 提交于 2019-12-02 10:35:39
I have python program main.py import subprocess p = subprocess.Popen( "/usr/bin/gnome-terminal -x 'handler.py'", shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE) p.stdin.write('Text sent to handler for display\n') where handler.py is #!/usr/bin/python print "In handler..." Program main.py opens a new gnome-terminal and runs handler.py to display "In handler...". How can I get handler.py to receive and print "Text sent to the handler for display" sent from main.py? The answer provided to question " Sending strings between python scripts " is the idea of what I'm after, where

Spinner Animation and echo command

本秂侑毒 提交于 2019-12-02 05:16:17
This is a part of my bash file. The output I need is: [ - ] Copyright of KatworX© Tech. Developed by Arjun Singh Kathait and Debugged by the ☆Stack Overflow Community☆ I want the spinner animation to continue spinning for 5 seconds while the echo command is being displayed. Can the community help??? spinner() { local pid=$! local delay=0.75 local spinstr='|/-\' while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do local temp=${spinstr#?} printf " [%c] " "$spinstr" local spinstr=$temp${spinstr%"$temp"} sleep $delay printf "\b\b\b\b\b\b" done } sleep 5 & spinner | echo -e "\nCopyright of

Opening multiple tabs in gnome terminal with complex commands from a cycle

时光毁灭记忆、已成空白 提交于 2019-12-01 20:44:02
问题 I have a command that needs to be called like this: command "complex argument" If I want to run gnome-terminal passing it this argument, it goes like this: gnome-terminal -e 'command "complex argument"' I want to open multiple tabs in the terminal, executing this command with different arguments each time. This works this way: gnome-terminal -e 'command "complex argument1"' --tab -e 'command "complex argument2"' But the problem comes if I want to execute it with a script, where I get the

Opening multiple tabs in gnome terminal with complex commands from a cycle

纵然是瞬间 提交于 2019-12-01 19:58:25
I have a command that needs to be called like this: command "complex argument" If I want to run gnome-terminal passing it this argument, it goes like this: gnome-terminal -e 'command "complex argument"' I want to open multiple tabs in the terminal, executing this command with different arguments each time. This works this way: gnome-terminal -e 'command "complex argument1"' --tab -e 'command "complex argument2"' But the problem comes if I want to execute it with a script, where I get the parameters for each tabs from a cycle (i.e. the number of tabs is variable). My basic idea was that I