Bug 161280 - bookmark infrequent or important commands
Summary: bookmark infrequent or important commands
Status: RESOLVED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-25 23:36 UTC by Roland
Modified: 2009-01-20 08:38 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland 2008-04-25 23:36:54 UTC
Version:            (using KDE 3.5.9)
Installed from:    Ubuntu Packages

Hi!

I have some commands, who i need some times, but they are very compicate like

bin/moneyplex/dkb-visa-read/dkb-visa-read.rb -t 15 xxxxxx
watch --i=1 cat /proc/acpi/{battery/*/state,thermal_zone/*/temperature}

ore some other. but i use konsole for other thinks too. so i have to search for my favorit commands or write it again.

i can be confortable, if i can safe the commandy in a commandlist, like bookmarks and start it from there.

bye
Comment 1 Robert Knight 2008-04-26 01:05:42 UTC
The commands you enter are usually saved by the shell.  How you activate the search depends on the shell.  If you are using bash (which the most common choice) then pressing Ctrl+R will start the search.  You can then type the first few letters of a command and bash will suggest a command from its history.  Pressing Ctrl+R repeatedly cycles through possible matches.  Pressing Ctrl+C cancels the search.

If you have a series of common commands that you wish to re-use then put them in a script.  Search for "Unix shell scripting" for more information.
Comment 2 Greg Rundlett 2008-11-10 16:27:20 UTC
Rob,

Please consider re-opening this bug.    I present a workaround at the bottom.

In current Konsole, you can save any string you want in the URL portion of a bookmark, but those bookmarks do not get echoed out to the Konsole window unless they meet some (unknown) criteria.

I'd say this is a bug (and actually a regression) because I too used the prior (Konsole 3.5.x Bookmarks) system to organize and "remember" a whole series of shell commands and 'shortcuts' .  In my example, I have the following categories of "bookmarks" in konsole:  

'development'
'network tricks'
'file ops'
'system info'
'setup, configuration'
'math tricks with bc'
'mail'
'sys admin'

The fact that I can write my own scripts, or use bash history is not a consolation.   Those methods are not nearly as useful nor convenient as having a bookmark menu built-in.  Infrequent commands will not even be accessible in bash history unless you set that to be "unlimited" (non-default).

For new and experienced users alike, it is very handy to be able to give a command a place to remember it, and a name to remember it by:

"list them all"                 ls -al
"list the newest files"    ls -alt | head
"list the oldest files"      ls -alt | tail

While those examples may look trivial and not significant enough to call this a regression, how about this example "bookmark":

"Take Temperature"   
tc=$(cat /proc/acpi/thermal_zone/THM/temperature|cut -d' ' -f 14); tf=$(echo "scale=2;((9/5) * $tc) +32" |bc); echo "temp is $tc C or $tf F" 

I use Konsole bookmarks expressly because they are favorite or useful shell commands that I can not only use and edit easily from within Konsole, but I can also back up, and replicate them across machines easily.  That is not something you'd even want to do with a history file. 

I am guessing that this regression is due to some new parsing and validation of the URL part by the KbookmarkEditor?  /If/ that is the cause for the change, then I'd have to say it's not considering the use cases that I mention here.  While http:// scheme is _one_ valid scheme for HTTP bookmarks, it is not even desirable for Konsole bookmarks to be "validated".  In limited testing, konsole does not echo bookmarks that begin with the string "http://", while bookmarks that begin with the string "file://" get translated to "cd /some/path"

This issue is reported again at https://bugs.kde.org/show_bug.cgi?id=173212 and https://bugs.kde.org/show_bug.cgi?id=174361

=== WORKAROUND ====
Click 'Bookmarks'
Position mouse to highlight desired bookmark
Right-click and select 'Copy Link Address'
In Konsole window, Right-click and Paste or press Ctrl+Shift+V
Comment 3 Robert Knight 2009-01-20 08:38:05 UTC
> While those examples may look trivial and not significant enough
>  to call this a regression, how about this example "bookmark": 

> "Take Temperature" tc=$(cat /proc/acpi/thermal_zone/THM/temperature|cut
> -d' ' -f 14); tf=$(echo "scale=2;((9/5) * $tc) +32" |bc); echo "temp is
> $tc C or $tf F" 

In all honesty I think that writing a bunch of scripts in a friendly language (ie. not sh) and placing them in a directory in your path would be a better way of doing this - for several reasons:

- They would be easier to read and come back to in future
- You can add comments, variable names etc.

And most importantly:

If you ever want to share these with someone else, they'll work in any version of any terminal.  If you want to share these across machines that would be much more straightforward than bookmarks assuming the scripts were placed on a shared directory somewhere.