terminal

How to determine a terminal's background color?

浪尽此生 提交于 2019-12-17 18:28:12
问题 I'd like to know if there is any way to determine a terminal's background color ? In my case, using gnome-terminal. It might matter, since it's entirety up to the terminal application to draw the background of its windows, which may even be something else than a plain color. 回答1: I've came up with the following: #!/bin/sh # # Query a property from the terminal, e.g. background color. # # XTerm Operating System Commands # "ESC ] Ps;Pt ST" oldstty=$(stty -g) # What to query? # 11: text

Handling special characters in C (UTF-8 encoding)

点点圈 提交于 2019-12-17 17:34:31
问题 I'm writing a small application in C that reads a simple text file and then outputs the lines one by one. The problem is that the text file contains special characters like Æ, Ø and Å among others. When I run the program in terminal the output for those characters are represented with a "?". Is there an easy fix? 回答1: First things first: Read in the buffer Use libiconv or similar to obtain wchar_t type from UTF-8 and use the wide character handling functions such as wprintf() Use the wide

How to create a .jar file using the terminal

别来无恙 提交于 2019-12-17 17:32:10
问题 I'm trying to create a .jar file using the mac terminal but am having bit of trouble. I followed the steps here but was unsuccessful. I got this error message: Failed to load Main-Class manifest attribute from aclient.jar So how exactly do you go about doing it? My java program is called Main.java and I have compiled it into a .class file. Now what do I do? Thanks 回答1: 1) Ensure that all necessary files are within the directory, you have opened a terminal/Command Prompt and have navigated to

How do I find the width & height of a terminal window?

北战南征 提交于 2019-12-17 17:28:16
问题 As a simple example, I want to write a CLI script which can print = across the entire width of the terminal window. #!/usr/bin/env php <?php echo str_repeat('=', ???); or #!/usr/bin/env python print '=' * ??? or #!/usr/bin/env bash x=0 while [ $x -lt ??? ]; do echo -n '='; let x=$x+1 done; echo 回答1: tput cols tells you the number of columns. tput lines tells you the number of rows. 回答2: In bash, the $LINES and $COLUMNS environmental variables should be able to do the trick. The will be set

Open terminal here in Mac OS finder [closed]

人走茶凉 提交于 2019-12-17 17:17:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. Is there something similar to the "Open Command Window Here" Windows Powertoy for Mac OS? I've found a couple plugins through a google

Read input.txt file and also output.bmp file from terminal (C-programming)

老子叫甜甜 提交于 2019-12-17 17:16:02
问题 I have to do an assignment where I have to write a C-Programm, where it gets the input-file-name from the console as command line parameter. It should move the data from the input.txt file (the input file has the information for the bmp file - color etc.) to the generated output.png file. The 20 20 parameters stand for width and height for the output.png image. So the console-request for example (tested on Linux) will look like this: ./main input.txt output.bmp 20 20 I know that this code

Angular2 - Could not find an NgModule

匆匆过客 提交于 2019-12-17 17:14:22
问题 Hello I've just created a new project from the CLI using the simple ng new frontend command however once I go into my project to: cd frontend/src/app and try to generate a new component like so ng generate component about I get the following error message in my terminal(MacOS): Could not find an NgModule. Use the skip-import option to skip importing in NgModule. I have installed Angular 2 globally and when I run my ng --version I receive the following: Angular CLI: 6.0.0 Node: 8.11.1 OS:

SSH.NET based colored terminal emulator

狂风中的少年 提交于 2019-12-17 16:48:06
问题 I'm using SSH.NET to create my terminal application for UWP. For now, I've been able to send/receive data with the library, but it I would like to do something like the putty application, that shows the text with different colors, or even being able to edit files with the Linux "vi" editor. Is there a way to get color / position information with this library? Thanks! 回答1: When implementing a terminal emulation, you primarily have to process ANSI escape codes sent by the server. There's no

in `require': no such file to load — iconv (LoadError)

拜拜、爱过 提交于 2019-12-17 16:32:36
问题 ➜ expertiza git:(master) ✗ ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.1.0] ➜ expertiza git:(master) ✗ rails -v Rails 2.3.14 ➜ expertiza git:(master) ✗ script/server /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3:in `require': no such file to load -- iconv (LoadError) from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3 from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems

Mouse movement events in NCurses

浪子不回头ぞ 提交于 2019-12-17 16:28:01
问题 I wonder if there is such a thing as mouse movement events in NCurses, and if there is a way to catch them. Following the Interfacing with the mouse (from the NCurses programming HOWTO) it seems that by enabling the REPORT_MOUSE_POSITION bit in the call to mousemask , one can indeed catch mouse movement events. So, I tried that and it does not seem to work. I have something like this: int ch, count=0; mmask_t old; initscr (); noecho (); cbreak (); mousemask (ALL_MOUSE_EVENTS | REPORT_MOUSE