terminal

How to fix git log output (missing lines in less)?

断了今生、忘了曾经 提交于 2019-12-19 19:01:13
问题 I have two different servers each running a Ubuntu installation. On both of them, I have set env LESS=-FerX which makes sure that git log output is displayed nicely. Also, line wrapping is turned on. On one of the servers, if I run git log and there are dynamically-wrapped lines, the topmost lines disappear. For example: log --pretty='format:%C(3)[%h] %Cgreen%an%Creset%n %cd %s %Cred%d%Creset' --graph Output on Server 1: * [1234457] John Doe | Date fooooo bar baz fooooo bar baz fooooo bar baz

Don't understand the backslash here

心已入冬 提交于 2019-12-19 16:52:33
问题 I am following this command on the readme file in github to copy a file but I don't understand how to type it in the terminal it has this backslash and terminal is spitting back that I am not using the copy command correctly cp -r rails_tutorial_sublime_text/* \ ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/ What do I actually type into terminal in this instance? 回答1: A backslash followed by a newline character means the command continues to the next line. You could remove the

Debugging ncurses with Eclipse CDT

你。 提交于 2019-12-19 16:16:18
问题 I'm writing a C++ application using ncurses in Eclipse CDT however I can't run/debug my app in eclipse because the console in eclipse does not work with curses. My app runs fine if I run it from a terminal but I just added some new code and now I'm getting a segmentation fault so I'd like to use the debugger in eclipse to help me fix the issue. Is there a way to have eclipse run/debug my application but use a different terminal for the output much like when you do "tty /dev/pts/1" in gdb? Or

Debugging ncurses with Eclipse CDT

浪尽此生 提交于 2019-12-19 16:16:06
问题 I'm writing a C++ application using ncurses in Eclipse CDT however I can't run/debug my app in eclipse because the console in eclipse does not work with curses. My app runs fine if I run it from a terminal but I just added some new code and now I'm getting a segmentation fault so I'd like to use the debugger in eclipse to help me fix the issue. Is there a way to have eclipse run/debug my application but use a different terminal for the output much like when you do "tty /dev/pts/1" in gdb? Or

Printing unicode characters to stdout in python prints wrong glyphs

半腔热情 提交于 2019-12-19 11:55:30
问题 I want to print a set of Unicode characters to my command prompt terminal. Even when I enforce the encoding to be "UTF-8" the terminal prints some garbage. $python -c "import sys; print sys.stdout.write(u'\u2044'.encode('UTF-8'))" ΓüäNone $python -c "import sys; print sys.stdout.encoding" cp437 My default terminal encoding is cp437 and I am trying to override that. The expected output here is Fraction slash ( ⁄ ) http://www.fileformat.info/info/unicode/char/2044/index.htm The same piece of

Moving multiple files with same name and renaming them on the fly

爷,独闯天下 提交于 2019-12-19 10:56:21
问题 I have multiple folders in my ubuntu 16.04 with pictures in them. I would like to move all pictures to one folder and rename all files with same name. I can easily move pictures from first folder, but how do i copy pictures from rest of the folders without destroying (copying over) all existing files with same name? Is there some handy oneliner that i could use in terminal for this? 回答1: cp has a useful option --backup=numbered that adds a numbered suffix to the name of a file that would

Run script in background?

*爱你&永不变心* 提交于 2019-12-19 10:28:13
问题 Simple question: Is there a way to run a script in the background with out terminal running? More detail and background: I had an app that read an apps .log file and puled information from it, then provide information and statistics from the information in the log. An update to the app changed the way the .log file was written and delete information and duplicates the log in a manner that i have been unable to predict. the app that was designed to interface with the log was not coded to check

Why do I need to press CTRL+D twice to break out of `while ((c=getchar())!=EOF)` in Ubuntu 14.10?

独自空忆成欢 提交于 2019-12-19 10:21:54
问题 I am new to C Programming and Ubuntu. I was reading the "The C Programming Language" by D.M Ritchie where I found the following code: #include <stdio.h> int main() { int c; int nc=0; while((c = getchar()) != EOF) { nc++; } printf("%d Characters \n",nc); return 0; } But while running the program I enter "Hello" ,then CTRL+D twice to get the actual number of characters which is 5. But when I enter "Hello" then CTRL+D once , nothing happens, the terminal still waits for input. Why? 回答1: Quoting

Why is the c++ standard library not working?

此生再无相见时 提交于 2019-12-19 09:57:33
问题 I've been trying to get my program that I downloaded from my schools server to run offline on my mac. I tried updating GCC by following tutorials and for some reason the tutorials didn't work even though I was using the commands given. Now when I compile.. I get an error saying that is not found.. I don't get it. I've updated Xcode.. followed tons of tutorials.. and I still can't get the thing to run! Why is it saying that random is not found, causing a fatal error? Thanks Error: DungeonLevel

GTK+ Vte.Terminal().fork_command_full removed?

╄→гoц情女王★ 提交于 2019-12-19 09:23:53
问题 I noticed this last week. All my code on ubuntu 15.04 was working fine using Vte.Terminal().fork_command_full Also this documentation site was showing this function as well, but does not now. Has this function been removed? If so, then what is the next simplest alternative to get a virtual terminal widget working. As this answer suggests the use of the above command, what is the next best way to get this widget up and running? NOTE: I am using python3 for this code 回答1: Update: This answer is