VSCode-Your IP Address in a Glance

Zujaj Misbah Khan
Level Up Coding
Published in
4 min readMay 31, 2021

--

Display the IP Address in your VSCode Status Bar with a single click.

VSCode-Your IP Address in a Glance
Depiction of Getting the IP Address in VSCode

THE PROBLEM STATEMENT

A sand clock depicting the concept “Time is money”
Time is Money

When you’re working in Visual Studio Code IDE, there comes a time when you require the IP Address on the machine your working on. It’s too much of a cumbersome job to open up the browser, depending upon your operating system; search the internet for the relevant commands that would display a long list of IP addresses and finally sort out the one that you require.

Also, it’s a frustrating job to repeat the process manually if the IP Address is not static. As a developer, you don’t want to waste your precious time by just going round and round all day.

THE SOLUTIONS WE MOSTLY ADOPT

FOR MICROSOFT WINDOWS

If your machine runs on Microsoft Windows Operating System, you would open up the command prompt and type ‘ipconfig’ that gives you a detailed result, as shown below.

MS Windows Command Prompt Displaying Machine IP Address
Source:ipconfig-highlighted.png (1128×886) (meridianoutpost.com)

FOR MAC OS

If you’re working on a Macintosh notebook, you would type ‘ifconfig’ in the terminal that produces a comprehensive output, as illustrated in the below figure.

Macintosh Terminal Displaying Machine IP Address
Source: Ipconfig Mac OS X | egeek

FOR LINUX OS

If you’re using a Linux-based operating system, you would navigate to the bash terminal, type ‘ifconfig’, and yield such output as depicted in the below image.

Linux Bash Terminal Displaying Machine IP Address
Source:ifconfig-basic.png (500×328) (howtoforge.com)

THIRD-PARTY SOFTWARE

If you’re an expert, you would write a script in any programming language or some shell script that would trigger and give you the IP address.

Python Script to Get IP Address

If you’re scared of programming, you would want to stick to a simple user interface, online website, or third-party software that does the work for you. Below are few examples:

Source:https://whatismyipaddress.com/
Advanced IP Scanner Displaying IP Addresses
Source:main.png (653×425) (advanced-ip-scanner.com)

WHAT VSCODE HAS OFFERED

The Visual Studio Code is a free, lightweight cross-platform tool that provides a developer with a robust environment to carry out programming tasks with ease of comfort. One of its remarkable features is that it allows broad functionality by installing extensions from the VSCode Marketplace.

At this moment, I would also like to share my problem. To run the firebase local emulator suite on a physical device, I needed the primary IP address of my laptop. It was quite a time-wasting job to open up the terminal and get the IP address manually; especially if I lost the internet connection, I would need to redo the same flow again.

Thanks to Compulim for publishing the IP Address extension; now, I can see my desired IP address on the VSCode status bar in just a blink of an eye.

Demo of IP Address in VSCode Status Bar
Source:demo-status-bar.gif (880×280) (raw.githubusercontent.com)

I can even insert the IP address from the command palette menu(pressing F1 or ctrl+shift+P or cmd+shift+P); see the below figure.

Demo of IP Address Insertion from VSCode Command Palette
Source:demo-insert.gif (1384×800) (raw.githubusercontent.com)

CONCLUSION

As a developer, I would say that it is a perfect solution that has saved my precious time, and I hope it will be time-saving for you. If you enjoyed this article, don’t press the clap button once; press it 50 times.

--

--

A passionate flutter developer who loves to learn, explore and share knowledge. Serving at https://telicsolutions.com/