Giter Site home page Giter Site logo

ft_select's Introduction

Ft_select 42

Codacy Badge Build Status

An implementation of an in-shell file dialog using termcaps [a 42 project].

This project aims to learn the very basics of using termcap library in C programming language. Ft_select is an argument viewer in the terminal that returns the user selection on the standard output.

Description

Ft_select displays a list of arguments in the running terminal. Pressing arrow keys on the keyboard will move the cursor throug the list of arguments passed to ft_select.

  • 'Arrow keys' will move the cursor through the circular list. The cursor underlines the file - appears as an underline font.

  • 'space' key will select/un-select one or more choices in the displayed list. A selection positions the cursor on the next element in the list if it exists. A selected file appears overlined.

  • 'return' key validates the selection. It displays the selection to the standard output. Other programs can take the output.

  • 'SIGWINCH' i.e. window resize signal, re-organizes the display or displays a blank screen if the list does not fit the window.

  • 'ESC' key exists the program.

  • 'delete' and 'backspace' keys removes an element from the list.

  • 'Ctrl + z' suspends the process and move it in background. (fg will bring in back)

  • 'Ctrl + c' will end the program.

Authorized functions:

isatty
ttyname
ttyslot
ioctl
getenv
tcsetattr
tcgetattr
tgetent
tgetflag
tgetnum
tgetstr
tgoto
tputs
open
close
write
malloc
free
read
exit
signal

Requirements

  • Termcap library:
sudo apt-get -y install libncurses5-dev

Usage

  • Clone the github repository
git clone --recurse-submodules https://github.com/Ant0wan/Ft_select.git && cd Ft_select/ && make -j
  • Build
cd Ft_select && make -j
  • Run, format ./ft_select + arguments
./ft_select ARG|...

For instance:

./ft_select Makefile README.md author ft_select ft_select.en.pdf libft src

Output:

screen shot 2017-07-23 at 5 05 13 pm

ft_select's People

Contributors

ant0wan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.